Use django.apps features instead of __import__

master
Manuel Francisco Naranjo 2015-07-28 08:33:42 -03:00
parent c7d74b34e0
commit 621ff0aa1f
1 changed files with 1 additions and 2 deletions

View File

@ -6,8 +6,7 @@ class CreateView(migrations.CreateModel):
if not self.allow_migrate_model(schema_editor.connection.alias, model):
raise
models = __import__(app_label).models
model = getattr(models, self.name)
model = apps.get_app_config(app_label).models_module
sql = 'DROP VIEW IF EXISTS %(table)s;'