oops, forgotten to qref enhancements made to the reledit doc addition stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 06 Sep 2011 12:10:02 +0200
branchstable
changeset 7760 75d80ef524c7
parent 7759 2cd77f21fd41
child 7761 46a8cf85d186
child 7763 31210a2ead63
oops, forgotten to qref enhancements made to the reledit doc addition
doc/book/en/devweb/views/reledit.rst
--- 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)
+
+