django-generate
django-generate copied to clipboard
Cache output using JSON dumps
I have the following use case that I'd like to have supported:
- Run
manage.py generate
ormanage.py syncdb
- Generator runs
- For each app, it saves all of it's output to
APPNAME/fixtures/generator.json
... This dump could be done the same waymanage.py dumpdata
is done.
The reason I need that is because I'd like to use the generated data in my unit tests. Right now, I use run_command('generate')
for each test which is really slow. With these automatic json dumps, I could just specify generator.json
which is much quicker.
Is this something you'd be willing to add?
Yes, good use case. Can you implement and I'll merge (not sure when I'll have a chance to do it myself)?
Unfortunately, I also don't have any time to do this right now.
I ended up just using dumpdata to get the same effects for now. Not a great solution but it works in the mean time.