Django

Code

Changeset 6317

Show
Ignore:
Timestamp:
09/15/07 14:37:12 (1 year ago)
Author:
jkocherhans
Message:

newforms-admin: Removed Model code and tests related to inner Admin classes. They are no longer used.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/newforms-admin/django/db/models/base.py

    r5984 r6317  
    171171 
    172172    def add_to_class(cls, name, value): 
    173         if name == 'Admin': 
    174             assert type(value) == types.ClassType, "%r attribute of %s model must be a class, not a %s object" % (name, cls.__name__, type(value)) 
    175             from django.contrib.admin.options import ModelAdmin 
    176             # Dynamically create a new ModelAdmin class, which is a subclass 
    177             # of both ModelAdmin and the 'class Admin' on this model. The 
    178             # resulting class is same as if the 'class Admin' were a subclass 
    179             # of ModelAdmin. 
    180             cls._meta.admin = type('ModelAdmin', (value, ModelAdmin), {}) 
    181         elif hasattr(value, 'contribute_to_class'): 
     173        if hasattr(value, 'contribute_to_class'): 
    182174            value.contribute_to_class(cls, name) 
    183175        else: