--- a/doc/book/en/devweb/views/reledit.rst Tue Sep 06 12:01:27 2011 +0200
+++ b/doc/book/en/devweb/views/reledit.rst Tue Sep 06 12:10:02 2011 +0200
@@ -119,11 +119,31 @@
Disable `reledit`
*****************
-By default, this feature is available on all attributes of every entity primary view.
-If you want to disable `reledit` feature, you have to override by using uicfg:
+By default, `reledit` is available on attributes and relations displayed in
+the 'attribute' section of the default primary view. If you want to disable
+it for some attribute or relation, you have use `uicfg`:
.. sourcecode:: python
import uicfg.primaryview_display_ctrl as _pvdc
_pvdc.tag_attribute(('Company', 'name'), {'vid': 'incontext'})
+To deactivate it everywhere it's used automatically, you may use the code snippet
+below somewhere in your cube's views:
+
+.. sourcecode:: python
+
+ from cubicweb.web.views import reledit
+
+ class DeactivatedAutoClickAndEditFormView(reledit.AutoClickAndEditFormView):
+ def _should_edit_attribute(self, rschema):
+ return False
+
+ def _should_edit_attribute(self, rschema, role):
+ return False
+
+ def registration_callback(vreg):
+ vreg.register_and_replace(DeactivatedAutoClickAndEditFormView,
+ reledit.AutoClickAndEditFormView)
+
+