Ticket #3632: forms.py.2.diff
File forms.py.2.diff, 792 bytes (added by , 17 years ago) |
---|
-
newforms/forms.py
38 38 if hasattr(base, 'base_fields'): 39 39 fields = base.base_fields.items() + fields 40 40 41 attrs['base_fields'] = SortedDict(fields) 41 # preserve initial values 42 base_fields = SortedDict(fields) 43 if attrs.get('base_fields'): 44 base_fields = base_fields.copy() 45 for k, v in attrs.get('base_fields').items(): 46 if k in base_fields: 47 base_fields[k].initial = v.initial 48 attrs['base_fields'] = base_fields 42 49 return type.__new__(cls, name, bases, attrs) 43 50 44 51 class BaseForm(StrAndUnicode):