1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

Changed django.db.models.indexes.Index imports to django.db.models.Index.

This commit is contained in:
Mariusz Felisiak 2019-07-08 14:11:50 +02:00
parent bc91f27a86
commit 8233144ca0
3 changed files with 6 additions and 7 deletions

View File

@ -1105,7 +1105,7 @@ class ModelStateTests(SimpleTestCase):
class Meta:
app_label = 'migrations'
abstract = True
indexes = [models.indexes.Index(fields=['name'])]
indexes = [models.Index(fields=['name'])]
class Child1(Abstract):
pass
@ -1131,7 +1131,7 @@ class ModelStateTests(SimpleTestCase):
class Meta:
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)
index_names = [index.name for index in model_state.options['indexes']]

View File

@ -10,8 +10,8 @@ class Book(models.Model):
class Meta:
indexes = [
models.indexes.Index(fields=['title']),
models.indexes.Index(fields=['isbn', 'id']),
models.Index(fields=['title']),
models.Index(fields=['isbn', 'id']),
]
@ -20,7 +20,7 @@ class AbstractModel(models.Model):
class Meta:
abstract = True
indexes = [models.indexes.Index(fields=['name'])]
indexes = [models.Index(fields=['name'])]
class ChildModel1(AbstractModel):

View File

@ -8,7 +8,7 @@ from django.core.management.color import no_style
from django.db import (
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.deletion import CASCADE, PROTECT
from django.db.models.fields import (
@ -19,7 +19,6 @@ from django.db.models.fields import (
from django.db.models.fields.related import (
ForeignKey, ForeignObject, ManyToManyField, OneToOneField,
)
from django.db.models.indexes import Index
from django.db.transaction import TransactionManagementError, atomic
from django.db.utils import DataError
from django.test import (