﻿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
10664	non-serializing fixtures	Luc Saffre	nobody	"I think that a new ""non-(de)serializing"" type of fixtures might be useful.
If loaddata finds a fixture of this type, then it simply executes it, assuming it is valid Python code.
Example of how such a fixture might look:

{{{
from myapp import MyModel
def add_mymodel(field1,field2,field3):
    MyModel(field1,field2,field3)

add_mymodel(""a"",1,True)
add_mymodel(""b"",2,True)
add_mymodel(""c"",3,True)
}}}

This example is only one possible application; in fact the programmer is free to write more sophisticated scripts, for example fetch data from different external sources (including csv files), or fill the database with randomly generated data,..

Such fixtures would offer the special characteristic that they execute custom save methods.
They would of course be slower than normal fixtures.

We can also extend dumpdata to support this format, outputting python code as in the example above. 
This would be useful when converting a database after model changes.

"	New feature	closed	Core (Serialization)	1.0	Normal	wontfix	fixtures		Design decision needed	0	1	0	0	0	0
