Ticket #5968: 5968-1.diff
File 5968-1.diff, 1.2 KB (added by , 16 years ago) |
---|
-
django/contrib/databrowse/sites.py
1 1 from django import http 2 2 from django.db import models 3 from django.db.models.base import ModelBase 3 4 from django.contrib.databrowse.datastructures import EasyModel 4 5 from django.shortcuts import render_to_response 5 6 from django.utils.safestring import mark_safe … … 85 86 If a model is already registered, this will raise AlreadyRegistered. 86 87 """ 87 88 databrowse_class = databrowse_class or DefaultModelDatabrowse 88 if is subclass(model_or_iterable, models.Model):89 if isinstance(model_or_iterable, ModelBase): 89 90 model_or_iterable = [model_or_iterable] 90 91 for model in model_or_iterable: 91 92 if model in self.registry: … … 98 99 99 100 If a model isn't already registered, this will raise NotRegistered. 100 101 """ 101 if is subclass(model_or_iterable, models.Model):102 if isinstance(model_or_iterable, ModelBase): 102 103 model_or_iterable = [model_or_iterable] 103 104 for model in model_or_iterable: 104 105 if model not in self.registry: