Ticket #6614: 6614_adminoptions_fix.diff

File 6614_adminoptions_fix.diff, 712 bytes (added by brosner, 8 years ago)

fixes newforms-admin as of r7121

  • django/db/models/base.py

    diff --git a/django/db/models/base.py b/django/db/models/base.py
    index 47c6934..8aec8ed 100644
    a b class ModelBase(type): 
    8282        return get_model(new_class._meta.app_label, name, False)
    8484    def add_to_class(cls, name, value):
    85         if name == 'Admin':
    86             assert type(value) == types.ClassType, "%r attribute of %s model must be a class, not a %s object" % (name, cls.__name__, type(value))
    87             value = AdminOptions(**dict([(k, v) for k, v in value.__dict__.items() if not k.startswith('_')]))
    8885        if hasattr(value, 'contribute_to_class'):
    8986            value.contribute_to_class(cls, name)
    9087        else:
Back to Top