1
0
mirror of https://github.com/django/django.git synced 2025-03-21 23:00:44 +00:00
Tim Graham e5880516f9 [1.11.x] Fixed #27915 -- Allowed Meta.indexes to be defined in abstract models.
Thanks Markus Holtermann for review.

Backport of 3d19d1428a05b514afb771b52870d1f7c25670d1 from master
2017-03-21 11:32:43 -04:00

24 lines
471 B
Python

from django.db import models
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