magic-removal: Changed variable name in django.db.models.base.Model.add_to_class()

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2019 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2006-01-16 23:35:09 +00:00
parent 90ff521e4e
commit 2a04bb9b58
1 changed files with 5 additions and 5 deletions

View File

@ -106,13 +106,13 @@ class Model(object):
setattr(self, self._meta.fields[i].attname, arg) setattr(self, self._meta.fields[i].attname, arg)
dispatcher.send(signal=signals.post_init, sender=self.__class__, instance=self) dispatcher.send(signal=signals.post_init, sender=self.__class__, instance=self)
def add_to_class(cls, name, attribute): def add_to_class(cls, name, value):
if name == 'Admin': if name == 'Admin':
attribute = AdminOptions(**dict([(k, v) for k, v in attribute.__dict__.items() if not k.startswith('_')])) value = AdminOptions(**dict([(k, v) for k, v in value.__dict__.items() if not k.startswith('_')]))
if hasattr(attribute, 'contribute_to_class'): if hasattr(value, 'contribute_to_class'):
attribute.contribute_to_class(cls, name) value.contribute_to_class(cls, name)
else: else:
setattr(cls, name, attribute) setattr(cls, name, value)
add_to_class = classmethod(add_to_class) add_to_class = classmethod(add_to_class)
def _prepare(cls): def _prepare(cls):