#5968: Registering/Unregistering multiple models fails
-----------------------+----------------------------------------------------
Reporter: anderso | Owner: nobody
Status: new | Component: django.contrib.databrowse
Version: SVN | Resolution:
Keywords: | Stage: Unreviewed
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 1
-----------------------+----------------------------------------------------
Comment (by anderso):
The intent of the original author was to allow either a Model or an
iterable of Models, but the check for identifying the actual case was
faulty. An *args parameter would probably be nicest but the function has
this signature, which doesn't make that a pretty option.
{{{
def register(self, model_or_iterable, databrowse_class=None, **options):
}}}
I have changed the patch to check if it's not an iterable instead of
checking if it's a Model. By the way, is hasattr(o, "__iter__") the best
way to check for an iterable?
--
Ticket URL: <http://code.djangoproject.com/ticket/5968#comment:2>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---