Ticket #4810: 4810.diff
File 4810.diff, 1.3 KB (added by , 17 years ago) |
---|
-
django/contrib/admin/sites.py
1 1 from django import http, template 2 2 from django.contrib.admin import ModelAdmin 3 3 from django.contrib.auth import authenticate, login 4 from django.db.models import Model4 from django.db.models.base import ModelBase 5 5 from django.shortcuts import render_to_response 6 6 from django.utils.text import capfirst 7 7 from django.utils.translation import ugettext_lazy, ugettext as _ … … 69 69 """ 70 70 admin_class = admin_class or ModelAdmin 71 71 # TODO: Handle options 72 if is subclass(model_or_iterable, Model):72 if isinstance(model_or_iterable, ModelBase): 73 73 model_or_iterable = [model_or_iterable] 74 74 for model in model_or_iterable: 75 75 if model in self._registry: … … 82 82 83 83 If a model isn't already registered, this will raise NotRegistered. 84 84 """ 85 if is subclass(model_or_iterable, Model):85 if isinstance(model_or_iterable, ModelBase): 86 86 model_or_iterable = [model_or_iterable] 87 87 for model in model_or_iterable: 88 88 if model not in self._registry: