1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #27915 -- Allowed Meta.indexes to be defined in abstract models.

Thanks Markus Holtermann for review.
This commit is contained in:
Tim Graham
2017-03-17 11:25:12 -04:00
parent 4224ecb74e
commit 3d19d1428a
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