Ticket #5968: allowiterable_2.diff

File allowiterable_2.diff, 1006 bytes (added by Anders Olsson, 17 years ago)
  • django/contrib/databrowse/sites.py

     
    8585        If a model is already registered, this will raise AlreadyRegistered.
    8686        """
    8787        databrowse_class = databrowse_class or DefaultModelDatabrowse
    88         if issubclass(model_or_iterable, models.Model):
     88        if not hasattr(model_or_iterable, "__iter__"):
    8989            model_or_iterable = [model_or_iterable]
    9090        for model in model_or_iterable:
    9191            if model in self.registry:
     
    9898
    9999        If a model isn't already registered, this will raise NotRegistered.
    100100        """
    101         if issubclass(model_or_iterable, models.Model):
     101        if not hasattr(model_or_iterable, "__iter__"):
    102102            model_or_iterable = [model_or_iterable]
    103103        for model in model_or_iterable:
    104104            if model not in self.registry:
Back to Top