# HG changeset patch # User Sylvain Thénault # Date 1263994784 -3600 # Node ID b9590e68c54372da8555a71aedea4a7240d4e95c # Parent 235fe518b2e487612930947a74f7496e92d356da allow control of generic relations field display through display_fields diff -r 235fe518b2e4 -r b9590e68c543 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 _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: