mirror of
https://github.com/django/django.git
synced 2025-11-25 05:04:26 +00:00
Fixed #27915 -- Allowed Meta.indexes to be defined in abstract models.
Thanks Markus Holtermann for review.
This commit is contained in:
parent
4224ecb74e
commit
3d19d1428a
6 changed files with 74 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue