# HG changeset patch # User Sylvain Thénault # Date 1269964468 -7200 # Node ID 981e85b14b47b85daf212e7f7d3e207b33c68166 # Parent d8f491cb046cc9a7fede4e14b8a1f61662811707 [form] CompoundField should not return itself in actual_fields, this avoid error on iliane with 3.7.2 where it's marked as required (from the schema) while value are provided by subfields diff -r d8f491cb046c -r 981e85b14b47 web/formfields.py --- a/web/formfields.py Tue Mar 30 17:50:09 2010 +0200 +++ b/web/formfields.py Tue Mar 30 17:54:28 2010 +0200 @@ -867,7 +867,7 @@ eids.add(typed_eid) return eids - +# XXX use cases where we don't actually want a better widget? class CompoundField(Field): def __init__(self, fields, *args, **kwargs): super(CompoundField, self).__init__(*args, **kwargs) @@ -877,7 +877,11 @@ return self.fields def actual_fields(self, form): - return [self] + list(self.fields) + # don't add [self] to actual fields, compound field is usually kinda + # virtual, all interesting values are in subfield. Skipping it may avoid + # error when processed by the editcontroller : it may be marked as required + # while it has no value, hence generating a false error. + return list(self.fields) _AFF_KWARGS = uicfg.autoform_field_kwargs