﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
5848	post_syncdb signal callbacks: argument 'created_models' is sometimes a list, sometimes a set	sam@…	nobody	"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."		closed	Core (Other)	dev		fixed	post_syncdb signal created_models		Ready for checkin	1	0	0	0	0	0
