parent
df60db0e78
commit
12474dacef
|
@ -1,3 +1,5 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import re
|
||||
import datetime
|
||||
|
||||
|
@ -380,7 +382,7 @@ class MigrationAutodetector(object):
|
|||
def add_to_migration(self, app_label, operation, new=False):
|
||||
migrations = self.migrations.setdefault(app_label, [])
|
||||
if not migrations or new:
|
||||
subclass = type("Migration", (Migration,), {"operations": [], "dependencies": []})
|
||||
subclass = type(str("Migration"), (Migration,), {"operations": [], "dependencies": []})
|
||||
instance = subclass("auto_%i" % (len(migrations) + 1), app_label)
|
||||
migrations.append(instance)
|
||||
migrations[-1].operations.append(operation)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations
|
||||
from .loader import MigrationLoader
|
||||
from .recorder import MigrationRecorder
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.utils.datastructures import OrderedSet
|
||||
from django.db.migrations.state import ProjectState
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from importlib import import_module
|
||||
import os
|
||||
import sys
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
|
||||
class Migration(object):
|
||||
"""
|
||||
The base class for all migrations.
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
|
||||
class Operation(object):
|
||||
"""
|
||||
Base class for migration operations.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import router
|
||||
from django.db.models.fields import NOT_PROVIDED
|
||||
from django.utils import six
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, router
|
||||
from django.db.models.options import normalize_together
|
||||
from django.db.migrations.state import ModelState
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from .base import Operation
|
||||
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import importlib
|
||||
import os
|
||||
import sys
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.apps.registry import Apps
|
||||
from django.db import models
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.apps import AppConfig
|
||||
from django.apps.registry import Apps, apps as global_apps
|
||||
from django.db import models
|
||||
|
@ -244,7 +246,7 @@ class ModelState(object):
|
|||
meta_contents.update(self.options)
|
||||
if "unique_together" in meta_contents:
|
||||
meta_contents["unique_together"] = list(meta_contents["unique_together"])
|
||||
meta = type("Meta", tuple(), meta_contents)
|
||||
meta = type(str("Meta"), tuple(), meta_contents)
|
||||
# Then, work out our bases
|
||||
try:
|
||||
bases = tuple(
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from operator import attrgetter
|
||||
|
||||
from django.apps import apps
|
||||
|
@ -1831,7 +1833,7 @@ def create_many_to_many_intermediary_model(field, klass):
|
|||
else:
|
||||
from_ = klass._meta.model_name
|
||||
to = to.lower()
|
||||
meta = type('Meta', (object,), {
|
||||
meta = type(str('Meta'), (object,), {
|
||||
'db_table': field._get_m2m_db_table(klass._meta),
|
||||
'managed': managed,
|
||||
'auto_created': klass,
|
||||
|
|
Loading…
Reference in New Issue