summaryrefslogtreecommitdiff
path: root/django/core/management/commands/flush.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2010-08-09 21:22:37 +0000
committerAlex Gaynor <alex.gaynor@gmail.com>2010-08-09 21:22:37 +0000
commit6001ba016a3db4701d56abc6d30868d4e5d88dbf (patch)
tree7a42c57d802484300c2384d3cd3a968de1804383 /django/core/management/commands/flush.py
parentc7bd48cb9f645e5ff07d1e68b86130e3bb2b043f (diff)
[soc2010/query-refactor] Merged up to trunk r13556, resolved merge conflictsarchive/soc2010/query-refactor
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2010/query-refactor@13565 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/core/management/commands/flush.py')
-rw-r--r--django/core/management/commands/flush.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/django/core/management/commands/flush.py b/django/core/management/commands/flush.py
index 43279c1a13..0ebe0108fb 100644
--- a/django/core/management/commands/flush.py
+++ b/django/core/management/commands/flush.py
@@ -1,7 +1,7 @@
from optparse import make_option
from django.conf import settings
-from django.db import connections, transaction, models, DEFAULT_DB_ALIAS
+from django.db import connections, router, transaction, models, DEFAULT_DB_ALIAS
from django.core.management import call_command
from django.core.management.base import NoArgsCommand, CommandError
from django.core.management.color import no_style
@@ -64,7 +64,13 @@ Are you sure you want to do this?
# Emit the post sync signal. This allows individual
# applications to respond as if the database had been
# sync'd from scratch.
- emit_post_sync_signal(models.get_models(), verbosity, interactive, db)
+ all_models = []
+ for app in models.get_apps():
+ all_models.extend([
+ m for m in models.get_models(app, include_auto_created=True)
+ if router.allow_syncdb(db, m)
+ ])
+ emit_post_sync_signal(all_models, verbosity, interactive, db)
# Reinstall the initial_data fixture.
kwargs = options.copy()