Fixed #21283 -- Added support for migrations if models is a package.

Thanks Markus Holtermann for the report.
This commit is contained in:
Loic Bistuer 2013-10-19 07:24:38 +07:00 committed by Tim Graham
parent 96d1d4e292
commit 584110417f
9 changed files with 46 additions and 13 deletions

View file

@ -41,8 +41,8 @@ class MigrationLoader(object):
def migrations_module(cls, app_label):
if app_label in settings.MIGRATION_MODULES:
return settings.MIGRATION_MODULES[app_label]
app = cache.get_app(app_label)
return ".".join(app.__name__.split(".")[:-1] + ["migrations"])
else:
return '%s.migrations' % cache.get_app_package(app_label)
def load_disk(self):
"""