summaryrefslogtreecommitdiff
path: root/django/core/management.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/core/management.py')
-rw-r--r--django/core/management.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/django/core/management.py b/django/core/management.py
index 91de11f3b3..79e57ff0c8 100644
--- a/django/core/management.py
+++ b/django/core/management.py
@@ -1463,20 +1463,24 @@ def load_data(fixture_labels, verbosity=1):
if verbosity > 1:
print "No %s fixture '%s' in %s." % \
(format, fixture_name, humanize(fixture_dir))
- 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)
+
+ if count[0] > 0:
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)
load_data.help_doc = 'Installs the named fixture(s) in the database'
load_data.args = "[--verbosity] fixture, fixture, ..."