Ticket #14082: modelform_factory_custom_metaclasses.diff

File modelform_factory_custom_metaclasses.diff, 690 bytes (added by Joseph Spiros, 14 years ago)
  • django/forms/models.py

     
    404404        'formfield_callback': formfield_callback
    405405    }
    406406
    407     return ModelFormMetaclass(class_name, (form,), form_class_attrs)
     407    form_metaclass = ModelFormMetaclass
    408408
     409    if issubclass(form, BaseModelForm) and hasattr(form, '__metaclass__'):
     410        form_metaclass = form.__metaclass__
    409411
     412    return form_metaclass(class_name, (form,), form_class_attrs)
     413
     414
    410415# ModelFormSets ##############################################################
    411416
    412417class BaseModelFormSet(BaseFormSet):
Back to Top