Ticket #3632: forms.py.diff

File forms.py.diff, 800 bytes (added by empty <mtrier@…>, 17 years ago)

Updated patch against trunk 6781

  • newforms/forms.py

     
    3838            if hasattr(base, 'base_fields'):
    3939                fields = base.base_fields.items() + fields
    4040
    41         attrs['base_fields'] = SortedDict(fields)
     41        # preserve initial values
     42        base_fields = SortedDictFromList(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
    4249        return type.__new__(cls, name, bases, attrs)
    4350
    4451class BaseForm(StrAndUnicode):
Back to Top