List Info

Thread: django.core.management changes




django.core.management changes
country flaguser name
United States
2007-08-30 13:43:27
hello,

my script creates a fixture file at FIXTURE_PATH, and then
runs the
reset command on my application. the relevant code is listed
below.
now that i synced to the latest trunk, this code no longer
runs
because the management module has no procedure 'reset'.

what is the proper way to do what i want now?

please help.
thanks.

konstantin

from django.core import management

management.reset(models.get_app('myapp'), interactive =
False)
management.load_data([FIXTURE_PATH], verbosity = 0)


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


Re: django.core.management changes
country flaguser name
United States
2007-08-30 13:51:20
try this:

from django.core.management import call_command
call_command( "reset", models.get_app('myapp'),
interactive = False )
call_command( "load_data", [FIXTURE_PATH],
verbosity = 0 )


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


Re: django.core.management changes
country flaguser name
United States
2007-08-30 14:18:02
Alex, thanks for your help.

the code that worked is:

    call_command('reset', 'myapp', interactive = False)
    call_command('loaddata', FIXTURE_PATH, verbosity = 0)

cheers
konstantin


On Aug 30, 2:51 pm, Alex Koshelev <daeva...gmail.com> wrote:
> try this:
>
> from django.core.management import call_command
> call_command( "reset",
models.get_app('myapp'), interactive = False )
> call_command( "load_data", [FIXTURE_PATH],
verbosity = 0 )


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


Re: django.core.management changes
user name
2007-08-30 23:00:22
On 8/30/07, akonsu <akonsugmail.com> wrote:
> my script creates a fixture file at FIXTURE_PATH, and
then runs the
> reset command on my application. the relevant code is
listed below.
> now that i synced to the latest trunk, this code no
longer runs
> because the management module has no procedure
'reset'.

If you are following Django's SVN version, *always* keep an
eye on the
list of backwards-incompatible changes:

http://code.djangoproject.com/wiki/BackwardsIncom
patibleChanges

Every time something like this happens, we document it. In
this case:

http://code.django
project.com/wiki/BackwardsIncompatibleChanges#Changestomanag
ement.pycommands

-- 
"Bureaucrat Conrad, you are technically correct -- the
best kind of correct."

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


[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )