web/formfields.py
changeset 2523 1d245fbbeb90
parent 2522 562f5dcf2345
child 2549 3d8c62e5e2d4
--- a/web/formfields.py	Mon Jul 27 18:42:49 2009 +0200
+++ b/web/formfields.py	Mon Jul 27 18:43:28 2009 +0200
@@ -473,6 +473,15 @@
         return value
 
 
+class CompoundField(Field):
+    def __init__(self, fields, *args, **kwargs):
+        super(CompoundField, self).__init__(*args, **kwargs)
+        self.fields = fields
+
+    def actual_fields(self, form):
+        return [self] + list(self.fields)
+
+
 def guess_field(eschema, rschema, role='subject', skip_meta_attr=True, **kwargs):
     """return the most adapated widget to edit the relation
     'subjschema rschema objschema' according to information found in the schema