[auto/inline forms] reallow nested inline forms #703910 stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Fri, 19 Feb 2010 12:14:35 +0100
branchstable
changeset 4642 606364845c34
parent 4641 9d8903b04031
child 4648 cf3b35545602
[auto/inline forms] reallow nested inline forms #703910
web/views/autoform.py
--- a/web/views/autoform.py	Thu Feb 18 15:42:29 2010 +0100
+++ b/web/views/autoform.py	Fri Feb 19 12:14:35 2010 +0100
@@ -568,18 +568,18 @@
                 except f.FieldNotFound:
                     # meta attribute such as <attr>_format
                     continue
+        if self.fieldsets_in_order:
+            fsio = list(self.fieldsets_in_order)
+        else:
+            fsio = [None]
+        self.fieldsets_in_order = fsio
+        # add fields for relation whose target should have an inline form
+        for formview in self.inlined_form_views():
+            field = self._inlined_form_view_field(formview)
+            self.fields.append(field)
+            if not field.fieldset in fsio:
+                fsio.append(field.fieldset)
         if self.formtype == 'main':
-            if self.fieldsets_in_order:
-                fsio = list(self.fieldsets_in_order)
-            else:
-                fsio = [None]
-            self.fieldsets_in_order = fsio
-            # add fields for relation whose target should have an inline form
-            for formview in self.inlined_form_views():
-                field = self._inlined_form_view_field(formview)
-                self.fields.append(field)
-                if not field.fieldset in fsio:
-                    fsio.append(field.fieldset)
             # add the generic relation field if necessary
             if entity.has_eid() and (
                 self.display_fields is None or