summaryrefslogtreecommitdiff
path: root/django/db
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-12-13 19:28:42 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-12-17 10:17:45 +0100
commit259cd3cd41a80a4725d669fa73498dbfe55a6fdf (patch)
tree7ef95373e716897398c99adbdbae4070dd31bf8d /django/db
parentda36d03fe69c35e2f289590c8c44c4c0d1281f24 (diff)
Deprecated get_app_package, get_app_path and get_app_paths.
Diffstat (limited to 'django/db')
-rw-r--r--django/db/migrations/loader.py2
-rw-r--r--django/db/migrations/writer.py8
2 files changed, 4 insertions, 6 deletions
diff --git a/django/db/migrations/loader.py b/django/db/migrations/loader.py
index f4a7168441..859e57f352 100644
--- a/django/db/migrations/loader.py
+++ b/django/db/migrations/loader.py
@@ -46,7 +46,7 @@ class MigrationLoader(object):
if app_label in settings.MIGRATION_MODULES:
return settings.MIGRATION_MODULES[app_label]
else:
- return '%s.migrations' % app_cache.get_app_package(app_label)
+ return '%s.migrations' % app_cache.get_app_config(app_label).name
def load_disk(self):
"""
diff --git a/django/db/migrations/writer.py b/django/db/migrations/writer.py
index 9356c8d8aa..a23a9b1253 100644
--- a/django/db/migrations/writer.py
+++ b/django/db/migrations/writer.py
@@ -69,14 +69,12 @@ class MigrationWriter(object):
migrations_module = import_module(migrations_package_name)
basedir = os.path.dirname(migrations_module.__file__)
except ImportError:
- app = app_cache.get_app(self.migration.app_label)
- app_path = app_cache._get_app_path(app)
- app_package_name = app_cache._get_app_package(app)
+ app_config = app_cache.get_app_config(self.migration.app_label)
migrations_package_basename = migrations_package_name.split(".")[-1]
# Alright, see if it's a direct submodule of the app
- if '%s.%s' % (app_package_name, migrations_package_basename) == migrations_package_name:
- basedir = os.path.join(app_path, migrations_package_basename)
+ if '%s.%s' % (app_config.name, migrations_package_basename) == migrations_package_name:
+ basedir = os.path.join(app_config.path, migrations_package_basename)
else:
raise ImportError("Cannot open migrations module %s for app %s" % (migrations_package_name, self.migration.app_label))
return os.path.join(basedir, self.filename)