# HG changeset patch # User Sylvain Thénault # Date 1315303802 -7200 # Node ID 75d80ef524c7203e3ad0cdec05355f2a1f76d474 # Parent 2cd77f21fd412a05bdacc362f4a0b36eec5f8045 oops, forgotten to qref enhancements made to the reledit doc addition diff -r 2cd77f21fd41 -r 75d80ef524c7 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) + +