mirror of
https://github.com/django/django.git
synced 2025-10-26 23:26:08 +00:00
Fixed #15926 -- Added option --no-initial-data to syncdb and flush.
Thanks msiedlarek, jpaugh64 and vlinhart!
This commit is contained in:
@@ -14,6 +14,8 @@ class Command(NoArgsCommand):
|
||||
option_list = NoArgsCommand.option_list + (
|
||||
make_option('--noinput', action='store_false', dest='interactive', default=True,
|
||||
help='Tells Django to NOT prompt the user for input of any kind.'),
|
||||
make_option('--no-initial-data', action='store_false', dest='load_initial_data', default=True,
|
||||
help='Tells Django not to load any initial data after database synchronization.'),
|
||||
make_option('--database', action='store', dest='database',
|
||||
default=DEFAULT_DB_ALIAS, help='Nominates a database to synchronize. '
|
||||
'Defaults to the "default" database.'),
|
||||
@@ -25,9 +27,6 @@ class Command(NoArgsCommand):
|
||||
verbosity = int(options.get('verbosity'))
|
||||
interactive = options.get('interactive')
|
||||
show_traceback = options.get('traceback')
|
||||
|
||||
# Stealth option -- 'load_initial_data' is used by the testing setup
|
||||
# process to disable initial fixture loading.
|
||||
load_initial_data = options.get('load_initial_data', True)
|
||||
|
||||
self.style = no_style()
|
||||
|
||||
Reference in New Issue
Block a user