django-generate icon indicating copy to clipboard operation
django-generate copied to clipboard

Cache output using JSON dumps

Open blanchardjeremy opened this issue 13 years ago • 2 comments

I have the following use case that I'd like to have supported:

  • Run manage.py generate or manage.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 way manage.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?

blanchardjeremy avatar Dec 21 '11 23:12 blanchardjeremy

Yes, good use case. Can you implement and I'll merge (not sure when I'll have a chance to do it myself)?

shaunsephton avatar Jan 04 '12 05:01 shaunsephton

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.

blanchardjeremy avatar Jan 09 '12 01:01 blanchardjeremy