Use django.apps features instead of __import__
parent
c7d74b34e0
commit
621ff0aa1f
|
|
@ -6,8 +6,7 @@ class CreateView(migrations.CreateModel):
|
||||||
|
|
||||||
if not self.allow_migrate_model(schema_editor.connection.alias, model):
|
if not self.allow_migrate_model(schema_editor.connection.alias, model):
|
||||||
raise
|
raise
|
||||||
models = __import__(app_label).models
|
model = apps.get_app_config(app_label).models_module
|
||||||
model = getattr(models, self.name)
|
|
||||||
|
|
||||||
sql = 'DROP VIEW IF EXISTS %(table)s;'
|
sql = 'DROP VIEW IF EXISTS %(table)s;'
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue