Ticket #15907: 15907_patch.diff
File 15907_patch.diff, 1.0 KB (added by , 14 years ago) |
---|
-
django/forms/models.py
384 384 # creating needs to inherit from the parent's inner meta. 385 385 parent = (object,) 386 386 if hasattr(form, 'Meta'): 387 if 'fields' in attrs and hasattr(form.Meta, 'fields'): 388 all_fields = tuple(attrs['fields']) + tuple(form.Meta.fields) 389 attrs['fields'] = tuple(set(all_fields)) 390 391 if 'exclude' in attrs and hasattr(form.Meta, 'exclude'): 392 all_exclude = tuple(attrs['exclude']) + tuple(form.Meta.exclude) 393 attrs['exclude'] = tuple(set(all_exclude)) 387 394 parent = (form.Meta, object) 388 395 Meta = type('Meta', parent, attrs) 389 396 … … 1022 1029 if hasattr(value, '__iter__'): 1023 1030 return [super(ModelMultipleChoiceField, self).prepare_value(v) for v in value] 1024 1031 return super(ModelMultipleChoiceField, self).prepare_value(value) 1032