summaryrefslogtreecommitdiff
path: root/django/core/management.py
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2007-05-14 14:14:49 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2007-05-14 14:14:49 +0000
commitc38a93e4d9f5ab31b22616c5573bba67946be493 (patch)
treecaa71fa3370716ab1faf05cb3ef1bfb0b321427e /django/core/management.py
parentf15036ae6de5b2a4a6640aeabab16076217e9ea2 (diff)
Fixed #4288 -- Modified serializers to pay attention to the to_field attribute on ForeignKeys. Thanks to Sandro Dentella for the report and the helpful test case.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5232 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/core/management.py')
-rw-r--r--django/core/management.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/django/core/management.py b/django/core/management.py
index 8785798abc..fda7050d5e 100644
--- a/django/core/management.py
+++ b/django/core/management.py
@@ -1404,20 +1404,23 @@ def load_data(fixture_labels, verbosity=1):
if verbosity > 1:
print "No %s fixture '%s' in %s." % \
(format, fixture_name, humanize(fixture_dir))
+
+ sequence_sql = backend.get_sql_sequence_reset(style, models)
+ if sequence_sql:
+ if verbosity > 1:
+ print "Resetting sequences"
+ for line in sequence_sql:
+ cursor.execute(line)
+
+ transaction.commit()
+ transaction.leave_transaction_management()
+
if count[0] == 0:
if verbosity > 0:
print "No fixtures found."
else:
if verbosity > 0:
print "Installed %d object(s) from %d fixture(s)" % tuple(count)
- sequence_sql = backend.get_sql_sequence_reset(style, models)
- if sequence_sql:
- if verbosity > 1:
- print "Resetting sequences"
- for line in sequence_sql:
- cursor.execute(line)
- transaction.commit()
- transaction.leave_transaction_management()
load_data.help_doc = 'Installs the named fixture(s) in the database'
load_data.args = "[--verbosity] fixture, fixture, ..."