Ticket #4239: forms.diff
File forms.diff, 832 bytes (added by , 18 years ago) |
---|
-
django/newforms/forms.py
37 37 'base_fields', taking into account parent class 'base_fields' as well. 38 38 """ 39 39 def __new__(cls, name, bases, attrs): 40 fields = [(field_name, attrs.pop(field_name)) for field_name, obj in attrs.items() if isinstance(obj, Field)] 41 fields.sort(lambda x, y: cmp(x[1].creation_counter, y[1].creation_counter)) 40 if attrs.has_key('base_fields'): 41 fields = attrs['base_fields'].items() 42 else: 43 fields = [] 42 44 43 45 # If this class is subclassing another Form, add that Form's fields. 44 46 # Note that we loop over the bases in *reverse*. This is necessary in