Hi Jacob,

> The mangement modules are designed for use from the command-line, so
> this is expected behavior.

OK. But the peculiar thing is that I'm almost certain that I had it
working before (2 months ago) with the command:
str_datadump = management.call_command('dumpdata', str_application,
format='json', indent=2)

Apparently, things have changed since then, and if this is expected
behavior, I have to adhere to it.

I found a (somewhat silly) workaround by calling manage.py as a shell
command within my own script:
str_shell_command = './manage.py dumpdata ' + str_application + ' > '
+ str_output_file + ' --format=json --indent=2'
bool_result = commands.getstatusoutput(str_shell_command)

> If you're looking to convert data into a
> string, you'll want to use the serialization APIs directly, 
> seehttp://www.djangoproject.com/documentation/serialization/.

Aha, but this seems to be an unnecessary advanced way to do a simple
thing as just dump the contents of a whole application. But I see that
you may do narrower model selections with this command, so it's a good
tip for future use.

Thanks for your help,
Ulf


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to