allow control of generic relations field display through display_fields
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 20 Jan 2010 14:39:44 +0100
changeset 4295 b9590e68c543
parent 4294 235fe518b2e4
child 4296 bb8a572d3f55
allow control of generic relations field display through display_fields
web/views/autoform.py
--- a/web/views/autoform.py	Wed Jan 20 14:39:10 2010 +0100
+++ b/web/views/autoform.py	Wed Jan 20 14:39:44 2010 +0100
@@ -89,7 +89,9 @@
                 except form.FieldNotFound:
                     # meta attribute such as <attr>_format
                     continue
-        if self.formtype == 'main' and entity.has_eid():
+        if self.formtype == 'main' and entity.has_eid() and (
+            self.display_fields is None or
+            '_cw_generic_field' in self.display_fields):
             try:
                 self.fields.append(self.field_by_name('_cw_generic_field'))
             except form.FieldNotFound: