Ticket #11823: flush_patch.txt

File flush_patch.txt, 1.9 KB (added by kapa77, 15 years ago)
Line 
1### Eclipse Workspace Patch 1.0
2#P prywatnezdrowie
3Index: django/core/management/commands/flush.py
4===================================================================
5--- django/core/management/commands/flush.py (revision 380)
6+++ django/core/management/commands/flush.py (working copy)
7@@ -7,6 +7,10 @@
8 option_list = NoArgsCommand.option_list + (
9 make_option('--noinput', action='store_false', dest='interactive', default=True,
10 help='Tells Django to NOT prompt the user for input of any kind.'),
11+ make_option('--nosyncdb', action='store_false', dest='syncdb_signal', default=True,
12+ help='Tells Django to NOT send syncdb signal after flush.'),
13+ make_option('--noloaddata', action='store_false', dest='loaddata', default=True,
14+ help='Tells Django to NOT run loaddata command after flush.'),
15 )
16 help = "Executes ``sqlflush`` on the current database."
17
18@@ -17,6 +21,8 @@
19
20 verbosity = int(options.get('verbosity', 1))
21 interactive = options.get('interactive')
22+ syncdb_signal = options.get('syncdb_signal')
23+ loaddata = options.get('loaddata')
24
25 self.style = no_style()
26
27@@ -58,11 +64,13 @@
28 # Emit the post sync signal. This allows individual
29 # applications to respond as if the database had been
30 # sync'd from scratch.
31- emit_post_sync_signal(models.get_models(), verbosity, interactive)
32+ if syncdb_signal:
33+ emit_post_sync_sgnal(models.get_models(), verbosity, interactive)
34
35 # Reinstall the initial_data fixture.
36- from django.core.management import call_command
37- call_command('loaddata', 'initial_data', **options)
38+ if loaddata:
39+ from django.core.management import call_command
40+ call_command('loaddata', 'initial_data', **options)
41
42 else:
43 print "Flush cancelled."
Back to Top