summaryrefslogtreecommitdiff
path: root/django/core
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-12-29 21:21:23 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-12-29 21:25:28 +0100
commit856aaaf2b15228bd5babbe44654c3c1ca39e8fd7 (patch)
treef5c2f6517a55101ffeea27e7134273cbed58a5d6 /django/core
parent1d4bcb86eab521aa3f9dfc52e77d8a51448aa0f7 (diff)
Changed get_migratable_models to use an app config.
Diffstat (limited to 'django/core')
-rw-r--r--django/core/management/commands/flush.py2
-rw-r--r--django/core/management/commands/migrate.py2
-rw-r--r--django/core/management/sql.py10
3 files changed, 7 insertions, 7 deletions
diff --git a/django/core/management/commands/flush.py b/django/core/management/commands/flush.py
index 619df9536c..5b4733ecad 100644
--- a/django/core/management/commands/flush.py
+++ b/django/core/management/commands/flush.py
@@ -94,5 +94,5 @@ Are you sure you want to do this?
# respond as if the database had been migrated from scratch.
all_models = []
for app_config in apps.get_app_configs(only_with_models_module=True):
- all_models.extend(router.get_migratable_models(app_config.models_module, database, include_auto_created=True))
+ all_models.extend(router.get_migratable_models(app_config, database, include_auto_created=True))
emit_post_migrate_signal(set(all_models), verbosity, interactive, database)
diff --git a/django/core/management/commands/migrate.py b/django/core/management/commands/migrate.py
index d7daafd279..5da5e51a48 100644
--- a/django/core/management/commands/migrate.py
+++ b/django/core/management/commands/migrate.py
@@ -180,7 +180,7 @@ class Command(BaseCommand):
# Build the manifest of apps and models that are to be synchronized
all_models = [
(app_config.label,
- router.get_migratable_models(app_config.models_module, connection.alias, include_auto_created=True))
+ router.get_migratable_models(app_config, connection.alias, include_auto_created=True))
for app_config in apps.get_app_configs(only_with_models_module=True)
if app_config.label in app_labels
]
diff --git a/django/core/management/sql.py b/django/core/management/sql.py
index 6f98282a9c..4cced4f566 100644
--- a/django/core/management/sql.py
+++ b/django/core/management/sql.py
@@ -31,7 +31,7 @@ def sql_create(app_config, style, connection):
known_models = set(model for model in connection.introspection.installed_models(tables) if model not in app_models)
pending_references = {}
- for model in router.get_migratable_models(app_config.models_module, connection.alias, include_auto_created=True):
+ for model in router.get_migratable_models(app_config, connection.alias, include_auto_created=True):
output, references = connection.creation.sql_create_model(model, style, known_models)
final_output.extend(output)
for refto, refs in references.items():
@@ -78,7 +78,7 @@ def sql_delete(app_config, style, connection):
to_delete = set()
references_to_delete = {}
- app_models = router.get_migratable_models(app_config.models_module, connection.alias, include_auto_created=True)
+ app_models = router.get_migratable_models(app_config, connection.alias, include_auto_created=True)
for model in app_models:
if cursor and connection.introspection.table_name_converter(model._meta.db_table) in table_names:
# The table exists, so it needs to be dropped
@@ -122,7 +122,7 @@ def sql_custom(app_config, style, connection):
"Returns a list of the custom table modifying SQL statements for the given app."
output = []
- app_models = router.get_migratable_models(app_config.models_module, connection.alias)
+ app_models = router.get_migratable_models(app_config, connection.alias)
for model in app_models:
output.extend(custom_sql_for_model(model, style, connection))
@@ -133,7 +133,7 @@ def sql_custom(app_config, style, connection):
def sql_indexes(app_config, style, connection):
"Returns a list of the CREATE INDEX SQL statements for all models in the given app."
output = []
- for model in router.get_migratable_models(app_config.models_module, connection.alias, include_auto_created=True):
+ for model in router.get_migratable_models(app_config, connection.alias, include_auto_created=True):
output.extend(connection.creation.sql_indexes_for_model(model, style))
return output
@@ -141,7 +141,7 @@ def sql_indexes(app_config, style, connection):
def sql_destroy_indexes(app_config, style, connection):
"Returns a list of the DROP INDEX SQL statements for all models in the given app."
output = []
- for model in router.get_migratable_models(app_config.models_module, connection.alias, include_auto_created=True):
+ for model in router.get_migratable_models(app_config, connection.alias, include_auto_created=True):
output.extend(connection.creation.sql_destroy_indexes_for_model(model, style))
return output