1
0
mirror of https://github.com/django/django.git synced 2025-07-04 09:49:12 +00:00

newforms-admin: Added missing 'self's to AdminSite class

git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@4586 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2007-02-25 22:01:20 +00:00
parent 77bdc85845
commit a9fafd521f

View File

@ -11,7 +11,7 @@ class AdminSite(object):
def __init__(self): def __init__(self):
self._registry = {} # model_class -> admin_class self._registry = {} # model_class -> admin_class
def register(model_or_iterable, admin_class=None, **options): def register(self, model_or_iterable, admin_class=None, **options):
""" """
Registers the given model(s) with the given admin class. Registers the given model(s) with the given admin class.
@ -30,7 +30,7 @@ class AdminSite(object):
raise AlreadyRegistered('The model %s is already registered' % model.__class__.__name__) raise AlreadyRegistered('The model %s is already registered' % model.__class__.__name__)
self._registry[model] = admin_class self._registry[model] = admin_class
def unregister(model_or_iterable): def unregister(self, model_or_iterable):
if issubclass(model_or_iterable, Model): if issubclass(model_or_iterable, Model):
model_or_iterable = [model_or_iterable] model_or_iterable = [model_or_iterable]
for model in model_or_iterable: for model in model_or_iterable: