#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
-----------------------+----------------------------------------------------
Changes (by mtredinnick):
* needs_better_patch: => 1
* needs_tests: => 0
* needs_docs: => 0
Comment:
Checking for something being an instance of `type` is usually a sign of
things going wrong. What are you actually trying to achieve here? Allowing
an iterable as an argument? If so, then check to see if it's an iterable,
not if it's a `type`, which is way too broad.
However, even that is probably not the best approach. If you're going to
try and allow multiple models to be registered, just let {{{register()}}}
take a {{{*args}}} parameter so the user doesn't have to needlessly wrap
things in a tuple or list and can just write
{{{
#!python
databrowse.site.register(model1, model2)
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/5968#comment:1>
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
-~----------~----~----~----~------~----~------~--~---