2008/1/21 Alex Koshelev <[EMAIL PROTECTED]>:
>
> Try this code:
>
> from django.core.management.commands.loaddata import Command
>
> def my_view( request, fixture_label1, fixture_label2 )
>     Command().handle( fixture_label1, fixture_label2 )
>     #...

While this will probably work, but the generally suggested invocation is:

from django.core import management

management.call_command('loaddata', 'fixture1.json', verbosity=0)

This ensures that any prevalidation on command arguments is performed.
It also means that you can easily invoke multiple Django commands in a
script, and you don't need to know where the command is registered in
order to use that command (which is useful for applications that
register their own management commands, like Django Evolution).

Yours,
Russ Magee %-)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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