summaryrefslogtreecommitdiff
path: root/django/core/management/commands/sqlsequencereset.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-12-27 15:17:56 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-12-28 09:43:06 +0100
commita7add2f2965dac3c2f63b1459c8bde725250c977 (patch)
treee20361686abfe75edaf2ce69c4b78afd9173c434 /django/core/management/commands/sqlsequencereset.py
parentbb8ec71f61066587aa3a8feb0aedab213422775a (diff)
Migrated built-in AppCommands to use handle_app_config.
Diffstat (limited to 'django/core/management/commands/sqlsequencereset.py')
-rw-r--r--django/core/management/commands/sqlsequencereset.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/django/core/management/commands/sqlsequencereset.py b/django/core/management/commands/sqlsequencereset.py
index 58f171e87b..d32ff3c5d0 100644
--- a/django/core/management/commands/sqlsequencereset.py
+++ b/django/core/management/commands/sqlsequencereset.py
@@ -19,6 +19,10 @@ class Command(AppCommand):
output_transaction = True
- def handle_app(self, app, **options):
+ def handle_app_config(self, app_config, **options):
+ if app_config.models_module is None:
+ return
connection = connections[options.get('database')]
- return '\n'.join(connection.ops.sequence_reset_sql(self.style, apps.get_models(app, include_auto_created=True)))
+ models = apps.get_models(app_config.models_module, include_auto_created=True)
+ statements = connection.ops.sequence_reset_sql(self.style, models)
+ return '\n'.join(statements)