Changeset 2018
- Timestamp:
- 01/16/06 17:27:59 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/magic-removal/django/db/models/base.py
r1977 r2018 20 20 if not hasattr(__builtins__, 'set'): 21 21 from sets import Set as set 22 23 attribute_transforms = {'Admin': lambda cls: AdminOptions(**dict([(k,v) for (k,v) in cls.__dict__.items() if not k.startswith('_')]))}24 22 25 23 class ModelBase(type): … … 110 108 111 109 def add_to_class(cls, name, attribute): 112 transform = attribute_transforms.get(name, None) 113 if transform: 114 attribute = transform(attribute) 110 if name == 'Admin': 111 attribute = AdminOptions(**dict([(k, v) for k, v in attribute.__dict__.items() if not k.startswith('_')])) 115 112 if hasattr(attribute, 'contribute_to_class'): 116 113 attribute.contribute_to_class(cls, name)
