1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

When looking for django tables which exist, query for all tables once, not once *per table*.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14402 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Alex Gaynor
2010-10-31 00:53:58 +00:00
parent aa951eb8ea
commit fa8f0cb2d8
4 changed files with 10 additions and 5 deletions

View File

@@ -9,7 +9,6 @@ from django.core.management.sql import sql_flush, emit_post_sync_signal
from django.utils.importlib import import_module
class Command(NoArgsCommand):
option_list = NoArgsCommand.option_list + (
make_option('--noinput', action='store_false', dest='interactive', default=True,

View File

@@ -111,7 +111,9 @@ def sql_flush(style, connection, only_django=False):
tables = connection.introspection.django_table_names(only_existing=True)
else:
tables = connection.introspection.table_names()
statements = connection.ops.sql_flush(style, tables, connection.introspection.sequence_list())
statements = connection.ops.sql_flush(
style, tables, connection.introspection.sequence_list()
)
return statements
def sql_custom(app, style, connection):