Changed django.db.models.indexes.Index imports to django.db.models.Index.
This commit is contained in:
parent
bc91f27a86
commit
8233144ca0
|
@ -1105,7 +1105,7 @@ class ModelStateTests(SimpleTestCase):
|
||||||
class Meta:
|
class Meta:
|
||||||
app_label = 'migrations'
|
app_label = 'migrations'
|
||||||
abstract = True
|
abstract = True
|
||||||
indexes = [models.indexes.Index(fields=['name'])]
|
indexes = [models.Index(fields=['name'])]
|
||||||
|
|
||||||
class Child1(Abstract):
|
class Child1(Abstract):
|
||||||
pass
|
pass
|
||||||
|
@ -1131,7 +1131,7 @@ class ModelStateTests(SimpleTestCase):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
app_label = 'migrations'
|
app_label = 'migrations'
|
||||||
indexes = [models.indexes.Index(fields=['name'], name='foo_idx')]
|
indexes = [models.Index(fields=['name'], name='foo_idx')]
|
||||||
|
|
||||||
model_state = ModelState.from_model(TestModel)
|
model_state = ModelState.from_model(TestModel)
|
||||||
index_names = [index.name for index in model_state.options['indexes']]
|
index_names = [index.name for index in model_state.options['indexes']]
|
||||||
|
|
|
@ -10,8 +10,8 @@ class Book(models.Model):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
indexes = [
|
indexes = [
|
||||||
models.indexes.Index(fields=['title']),
|
models.Index(fields=['title']),
|
||||||
models.indexes.Index(fields=['isbn', 'id']),
|
models.Index(fields=['isbn', 'id']),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ class AbstractModel(models.Model):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
abstract = True
|
abstract = True
|
||||||
indexes = [models.indexes.Index(fields=['name'])]
|
indexes = [models.Index(fields=['name'])]
|
||||||
|
|
||||||
|
|
||||||
class ChildModel1(AbstractModel):
|
class ChildModel1(AbstractModel):
|
||||||
|
|
|
@ -8,7 +8,7 @@ from django.core.management.color import no_style
|
||||||
from django.db import (
|
from django.db import (
|
||||||
DatabaseError, IntegrityError, OperationalError, connection,
|
DatabaseError, IntegrityError, OperationalError, connection,
|
||||||
)
|
)
|
||||||
from django.db.models import Model, Q
|
from django.db.models import Index, Model, Q
|
||||||
from django.db.models.constraints import CheckConstraint, UniqueConstraint
|
from django.db.models.constraints import CheckConstraint, UniqueConstraint
|
||||||
from django.db.models.deletion import CASCADE, PROTECT
|
from django.db.models.deletion import CASCADE, PROTECT
|
||||||
from django.db.models.fields import (
|
from django.db.models.fields import (
|
||||||
|
@ -19,7 +19,6 @@ from django.db.models.fields import (
|
||||||
from django.db.models.fields.related import (
|
from django.db.models.fields.related import (
|
||||||
ForeignKey, ForeignObject, ManyToManyField, OneToOneField,
|
ForeignKey, ForeignObject, ManyToManyField, OneToOneField,
|
||||||
)
|
)
|
||||||
from django.db.models.indexes import Index
|
|
||||||
from django.db.transaction import TransactionManagementError, atomic
|
from django.db.transaction import TransactionManagementError, atomic
|
||||||
from django.db.utils import DataError
|
from django.db.utils import DataError
|
||||||
from django.test import (
|
from django.test import (
|
||||||
|
|
Loading…
Reference in New Issue