#6034: Add boolean option 'load_fixtures' to the django command 'syncdb',
default
value is True.
---------------------------------+------------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: nobody
Status: reopened | Component: django-admin.py
Version: SVN | Resolution:
Keywords: syncdb | Stage: Design decision needed
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
---------------------------------+------------------------------------------
Changes (by favo):
* cc: [EMAIL PROTECTED] (added)
* status: closed => reopened
* resolution: wontfix =>
* stage: Unreviewed => Design decision needed
Comment:
Hi russellm,
Thanks for your comment. I think it's not bad to give us more control on
syncdb command.
django-admin.py syncdb --load_fixtures=False # Don't load fixture
automatically. Default is True, so don't break current logic.
The only reason we need to do this like Delimy said above is:
we write some new model in doctest, to help us test our related model(
think about you need test your generic tag system, you need a main model.)
{{{
#!python
"""
Create a test model
>>> class TestModel(models.Model)
... title = xxx
>>> call_command('sync')
"""
}}}
we also changed django test framework to use rollback instead of flush db,
which is more friendly(allow you use a exist db data to test rather than
put everything to fixture. sometime fixture can't describe our test data,
we have database view, something like this.). so the issue is with in
syncdb command will call loaddata command. and in loaddata commend logic,
it go into another transcation and commit at the end. which break outside
transaction.
So we add an option to syncdb command to across, IMO it's not bad, it's
cheap. However we can use django.core.management.sql method instead, of
course.
--
Ticket URL: <http://code.djangoproject.com/ticket/6034#comment:3>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" 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-updates?hl=en
-~----------~----~----~----~------~----~------~--~---