1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

[1.11.x] Fixed #27915 -- Allowed Meta.indexes to be defined in abstract models.

Thanks Markus Holtermann for review.

Backport of 3d19d1428a from master
This commit is contained in:
Tim Graham
2017-03-17 11:25:12 -04:00
parent 5310106ee3
commit e5880516f9
6 changed files with 74 additions and 7 deletions

View File

@@ -5,3 +5,19 @@ class Book(models.Model):
title = models.CharField(max_length=50)
author = models.CharField(max_length=50)
pages = models.IntegerField(db_column='page_count')
class AbstractModel(models.Model):
name = models.CharField(max_length=50)
class Meta:
abstract = True
indexes = [models.indexes.Index(fields=['name'])]
class ChildModel1(AbstractModel):
pass
class ChildModel2(AbstractModel):
pass