Django

Code

Changeset 5999

Show
Ignore:
Timestamp:
08/24/07 08:38:10 (1 year ago)
Author:
russellm
Message:

newforms-admin: Fixed #4571 -- Clarified type check to allow multiple class registrations with an admin site. Thanks to Jakub Vysoky for the patch.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/newforms-admin/django/contrib/admin/sites.py

    r5998 r5999  
    7373        admin_class = admin_class or ModelAdmin 
    7474        # TODO: Handle options 
    75         if issubclass(model_or_iterable, Model): 
     75        if type(model_or_iterable) not in (list, tuple): 
    7676            model_or_iterable = [model_or_iterable] 
    7777        for model in model_or_iterable: 
     
    8686        If a model isn't already registered, this will raise NotRegistered. 
    8787        """ 
    88         if issubclass(model_or_iterable, Model): 
     88        if type(model_or_iterable) not in (list, tuple): 
    8989            model_or_iterable = [model_or_iterable] 
    9090        for model in model_or_iterable: