mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16: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
@@ -340,6 +340,13 @@ Django quotes column and table names behind the scenes.
|
||||
This list of fields will be indexed together (i.e. the appropriate
|
||||
``CREATE INDEX`` statement will be issued.)
|
||||
|
||||
.. versionchanged:: 1.7
|
||||
|
||||
For convenience, ``index_together`` can be a single list when dealing with a single
|
||||
set of fields::
|
||||
|
||||
index_together = ["pub_date", "deadline"]
|
||||
|
||||
``verbose_name``
|
||||
----------------
|
||||
|
||||
|
||||
@@ -642,6 +642,9 @@ Models
|
||||
an error (before that, it would either result in a database error or
|
||||
incorrect data).
|
||||
|
||||
* You can use a single list for :attr:`~django.db.models.Options.index_together`
|
||||
(rather than a list of lists) when specifying a single set of fields.
|
||||
|
||||
Signals
|
||||
^^^^^^^
|
||||
|
||||
|
||||
Reference in New Issue
Block a user