web/views/autoform.py
branchreldefsecurity
changeset 3889 8902b8745918
parent 3877 7ca53fc72a0a
parent 3874 7d0d4a6be046
child 3890 d7a270f50f54
--- a/web/views/autoform.py	Thu Nov 19 12:55:47 2009 +0100
+++ b/web/views/autoform.py	Fri Nov 20 17:51:34 2009 +0100
@@ -182,6 +182,8 @@
                 except form.FieldNotFound:
                     # meta attribute such as <attr>_format
                     continue
+        fnum = len(self.fields)
+        self.fields.sort(key=lambda f: f.order is None and fnum or f.order)
         self.maxrelitems = self.req.property_value('navigation.related-limit')
         self.force_display = bool(self.req.form.get('__force_display'))