Test Model under shell

1 view
Skip to first unread message

Le Van

unread,
Jan 23, 2007, 10:16:55 PM1/23/07
to django...@googlegroups.com
Dear all,
I follow the tutorial 'Custom SQL In Django'. When I tested model
under shell environment, each time I modified the GroupManager class in
models.py module , I need to run manage.py sync to reflect the change.
I don't like it at all. Do I need to run mange.py sync or is there
another way to test ?
Thank you all,

Rubic

unread,
Jan 23, 2007, 10:31:45 PM1/23/07
to Django users
On Jan 23, 9:16 pm, Le Van <l...@it.gweg.com.vn> wrote:
> I need to run manage.py sync to reflect the change.
> I don't like it at all. Do I need to run mange.py sync or is there
> another way to test ?

You can call the django.core.management functions from your
own code. I do something similar to purge my multi-app database
during testing/development:

for mod in [models.get_app(app_label) for app_label in appnames]:
django.core.management.reset(mod, False)

--
Jeff Bauer
Rubicon, Inc.

Reply all
Reply to author
Forward
0 new messages