verbosity = int(options.get('verbosity', 1))
show_traceback = options.get('traceback', False)
+ # commit is a stealth option - it isn't really useful as
+ # a command line option, but it can be useful when invoking
+ # loaddata from within another script.
+ # If commit=True, loaddata will use its own transaction;
+ # if commit=False, the data load SQL will become part of
+ # the transaction in place when loaddata was invoked.
+ commit = options.get('commit', True)
# Keep a count of the installed objects and fixtures
# Start transaction management. All fixtures are installed in a
# single transaction to ensure that all references are resolved.
app_fixtures = [os.path.join(os.path.dirname(app.__file__), 'fixtures') for app in get_apps()]
for fixture_label in fixture_labels:
(format, fixture_name, humanize(fixture_dir))
- # If any of the fixtures we loaded contain 0 objects, assume that an
+ # If any of the fixtures we loaded contain 0 objects, assume that an
# error was encountered during fixture loading.
if 0 in objects_per_fixture:
- # If we found even one object in a fixture, we need to reset the
+ # If we found even one object in a fixture, we need to reset the
sequence_sql = connection.ops.sequence_reset_sql(self.style, models)
print "Resetting sequences"
for line in sequence_sql:
# edge case in MySQL: if the same connection is used to
# create tables, load data, and query, the query can return
# incorrect results. See Django #7572, MySQL #37735.