diff --git a/django/core/management/commands/flush.py b/django/core/management/commands/flush.py
index 87a99b8..25d6793 100644
a
|
b
|
class Command(NoArgsCommand):
|
9 | 9 | help='Verbosity level; 0=minimal output, 1=normal output, 2=all output'), |
10 | 10 | make_option('--noinput', action='store_false', dest='interactive', default=True, |
11 | 11 | help='Tells Django to NOT prompt the user for input of any kind.'), |
| 12 | make_option('--no-initial-data', action='store_false', dest='load_initial_data', default=True, |
| 13 | help='Tells Django not to load any initial data after database synchronization.'), |
12 | 14 | ) |
13 | 15 | help = "Executes ``sqlflush`` on the current database." |
14 | 16 | |
… |
… |
Are you sure you want to do this?
|
63 | 65 | # sync'd from scratch. |
64 | 66 | emit_post_sync_signal(models.get_models(), verbosity, interactive) |
65 | 67 | |
66 | | # Reinstall the initial_data fixture. |
67 | | from django.core.management import call_command |
68 | | call_command('loaddata', 'initial_data', **options) |
| 68 | if options.get('load_initial_data', True): |
| 69 | # Reinstall the initial_data fixture. |
| 70 | from django.core.management import call_command |
| 71 | call_command('loaddata', 'initial_data', **options) |
69 | 72 | |
70 | 73 | else: |
71 | 74 | print "Flush cancelled." |
diff --git a/django/core/management/commands/syncdb.py b/django/core/management/commands/syncdb.py
index 8017ed8..dbbbf84 100644
a
|
b
|
class Command(NoArgsCommand):
|
15 | 15 | help='Verbosity level; 0=minimal output, 1=normal output, 2=all output'), |
16 | 16 | make_option('--noinput', action='store_false', dest='interactive', default=True, |
17 | 17 | help='Tells Django to NOT prompt the user for input of any kind.'), |
| 18 | make_option('--no-initial-data', action='store_false', dest='load_initial_data', default=True, |
| 19 | help='Tells Django not to load any initial data after database synchronization.'), |
18 | 20 | ) |
19 | 21 | help = "Create the database tables for all apps in INSTALLED_APPS whose tables haven't already been created." |
20 | 22 | |
… |
… |
class Command(NoArgsCommand):
|
134 | 136 | transaction.rollback_unless_managed() |
135 | 137 | else: |
136 | 138 | transaction.commit_unless_managed() |
137 | | |
138 | | # Install the 'initial_data' fixture, using format discovery |
139 | | from django.core.management import call_command |
140 | | call_command('loaddata', 'initial_data', verbosity=verbosity) |
| 139 | if options.get('load_initial_data', true): |
| 140 | # Install the 'initial_data' fixture, using format discovery |
| 141 | from django.core.management import call_command |
| 142 | call_command('loaddata', 'initial_data', verbosity=verbosity) |