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):
|
||||
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;'
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue