1
0
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:
Anubhav Joshi
2014-03-02 00:36:15 +05:30
committed by Tim Graham
parent 3273bd7b25
commit bb2ca9fe6c
10 changed files with 67 additions and 19 deletions

View File

@@ -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):