mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #22172 -- Allowed index_together to be a single list (rather than list of lists)..
Thanks EmilStenstrom for the suggestion.
This commit is contained in:
committed by
Tim Graham
parent
3273bd7b25
commit
bb2ca9fe6c
@@ -12,6 +12,14 @@ class Article(models.Model):
|
||||
]
|
||||
|
||||
|
||||
# Model for index_together being used only with single list
|
||||
class IndexTogetherSingleList(models.Model):
|
||||
headline = models.CharField(max_length=100)
|
||||
pub_date = models.DateTimeField()
|
||||
|
||||
class Meta:
|
||||
index_together = ["headline", "pub_date"]
|
||||
|
||||
# Indexing a TextField on Oracle or MySQL results in index creation error.
|
||||
if connection.vendor == 'postgresql':
|
||||
class IndexedArticle(models.Model):
|
||||
|
||||
Reference in New Issue
Block a user