Fixing django.apps bug
parent
17db0219ae
commit
7138f9388e
|
|
@ -1,4 +1,5 @@
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
from django.apps import apps
|
||||||
|
|
||||||
class CreateView(migrations.CreateModel):
|
class CreateView(migrations.CreateModel):
|
||||||
def database_forwards(self, app_label, schema_editor, from_state, to_state):
|
def database_forwards(self, app_label, schema_editor, from_state, to_state):
|
||||||
|
|
@ -6,7 +7,8 @@ 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
|
||||||
model = apps.get_app_config(app_label).models_module
|
models = 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