[FIX] fields: inherited fields get their attribute 'state' from their base field

This commit is contained in:
Raphael Collet 2014-12-02 14:20:52 +01:00
parent 085e8e49c1
commit 591e329bb0
1 changed files with 4 additions and 0 deletions

View File

@ -474,6 +474,10 @@ class Field(object):
self._free_attrs.append(attr)
setattr(self, attr, getattr(field, attr))
# special case for states: copy it only for inherited fields
if not self.states and self.inherited:
self.states = field.states
# special case for required: check if all fields are required
if not self.store and not self.required:
self.required = all(field.required for field in fields)