views:

239

answers:

1

Hi,

I have a lot of things in my initial_data.json right now. I wondered if there is a way to split the data in files (by model) so that all of the files are loaded via same manage syncdb command?

Thanks, Nick

I recently revisited the problem, and came up with a better way of hooking code to 'real' post_syncdb signal:

http://www.djangosnippets.org/snippets/1988/

A: 

Yes, syncdb will load everything from your app/sql/modelname.sql on syncdb once for each model file - that's not exactly json though, only pure SQL can go there.

If you want to split your json fixtures you have to name them something like mymodel.json, put it inside app/fixtures/, and do manage.py loaddata mymodel manually after syncdb

kibitzer
Thanks! Maybe they'll change it one day, would be useful :)
Nick