#5848: post_syncdb signal callbacks: argument 'created_models' is sometimes a
list, sometimes an str
------------------------------+---------------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: nobody
Status: new | Component: Uncategorized
Version: SVN | Keywords:
Stage: Unreviewed | Has_patch: 0
------------------------------+---------------------------------------------
I have a function hooked up to the post_syncdb signal. When the function
is called as a result of running the 'syncdb' management command, the
created_models argument is a set. But when the function is called from the
'flush' management command, the created_models argument is a list.
{{{
def type_test (sender, app, created_models, verbosity, interactive):
print type (created_models)
dispatcher.connect (type_test, signal = signals.post_syncdb)
}}}
{{{
$ p/manage.py test
...
<type 'set'>
<type 'set'>
<type 'set'>
...
<type 'list'>
<type 'list'>
<type 'list'>
}}}
This is a problem because one of my functions checks to see if it actually
has to do something with a for loop that looks like {{{for m in
created_models.intersection (django.db.models.get_models (app))}}}. I
don't mind changing that to something that works with both lists and sets,
but it would be nice if this inconsistency was cleaned up anyway.
--
Ticket URL: <http://code.djangoproject.com/ticket/5848>
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
-~----------~----~----~----~------~----~------~--~---