Deactivating the 'reledit' feature

The 'reledit' feature is the one that makes attributes/relations editable in entity's primary view for authorized users (you know, the pen that appears when your mouse is over a field's value, clicking on it making a form to edit this field appears).

This is a nice feature, but you may not want it. It can be easily deactivated everywhere it's used automatically in the site by using the code snippet below:

from cubicweb.web.views import editformsclass DeactivatedAutoClickAndEditFormView(editforms.AutoClickAndEditFormView):
def should_edit_attribute(self, entity, rschema, form):
return Falsedef should_edit_relation(self, entity, rschema, role, rvid):
return Falsedef registration_callback(vreg):
vreg.register_and_replace(DeactivatedAutoClickAndEditFormView,
editforms.AutoClickAndEditFormView)