web/formfields.py
branchstable
changeset 3874 7d0d4a6be046
parent 3873 4d95109582c7
child 3890 d7a270f50f54
child 4131 d8ca873142f4
--- a/web/formfields.py	Wed Nov 18 12:32:57 2009 +0100
+++ b/web/formfields.py	Wed Nov 18 12:50:23 2009 +0100
@@ -81,6 +81,8 @@
        role of the entity in the relation (eg 'subject' or 'object')
     :fieldset:
        optional fieldset to which this field belongs to
+    :order:
+       key used by automatic forms to sort fields
 
     """
     # default widget associated to this class of fields. May be overriden per
@@ -94,7 +96,7 @@
     def __init__(self, name=None, id=None, label=None, help=None,
                  widget=None, required=False, initial=None,
                  choices=None, sort=True, internationalizable=False,
-                 eidparam=False, role='subject', fieldset=None):
+                 eidparam=False, role='subject', fieldset=None, order=None):
         self.name = name
         self.id = id or name
         self.label = label or name
@@ -108,6 +110,7 @@
         self.role = role
         self.fieldset = fieldset
         self.init_widget(widget)
+        self.order = order
         # ordering number for this field instance
         self.creation_rank = Field.__creation_rank
         Field.__creation_rank += 1