Ticket #8164: fieldsort.diff
File fieldsort.diff, 870 bytes (added by , 16 years ago) |
---|
-
django/forms/models.py
240 240 fields.update(declared_fields) 241 241 else: 242 242 fields = declared_fields 243 # Sort by order specified in fields 244 sorted_field_list = [] 245 for f in opts.fields: 246 if f in fields: 247 sorted_field_list.append((f,fields.pop(f))) 248 sorted_fields = SortedDict(sorted_field_list) 249 # Don't forget to add fields not explicitly mentioned in fields 250 sorted_fields.update(fields) 243 251 new_class.declared_fields = declared_fields 244 new_class.base_fields = fields252 new_class.base_fields = sorted_fields 245 253 return new_class 246 254 247 255 class BaseModelForm(BaseForm):