summaryrefslogtreecommitdiff
path: root/docs/ref/models
diff options
context:
space:
mode:
authorFabrizio Ettore Messina <zauddelig@gmail.com>2018-03-08 16:56:55 +0100
committerTim Graham <timograham@gmail.com>2018-03-08 10:56:55 -0500
commit10c0fe528a2089f4ba206caa50f9a98f8d9c8a15 (patch)
treea78d28e6095e37edea608b981ab727fc3f832778 /docs/ref/models
parent8411e4a8fe98ebac4327ee43446a25873703a5e8 (diff)
Fixed #29178 -- Allowed Index.fields to accept a tuple.
Diffstat (limited to 'docs/ref/models')
-rw-r--r--docs/ref/models/indexes.txt8
1 files changed, 6 insertions, 2 deletions
diff --git a/docs/ref/models/indexes.txt b/docs/ref/models/indexes.txt
index daecdd7f9a..5cb4f4ea2f 100644
--- a/docs/ref/models/indexes.txt
+++ b/docs/ref/models/indexes.txt
@@ -21,7 +21,7 @@ options`_.
``Index`` options
=================
-.. class:: Index(fields=[], name=None, db_tablespace=None)
+.. class:: Index(fields=(), name=None, db_tablespace=None)
Creates an index (B-Tree) in the database.
@@ -30,7 +30,7 @@ options`_.
.. attribute:: Index.fields
-A list of the name of the fields on which the index is desired.
+A list or tuple of the name of the fields on which the index is desired.
By default, indexes are created with an ascending order for each column. To
define an index with a descending order for a column, add a hyphen before the
@@ -40,6 +40,10 @@ For example ``Index(fields=['headline', '-pub_date'])`` would create SQL with
``(headline, pub_date DESC)``. Index ordering isn't supported on MySQL. In that
case, a descending index is created as a normal index.
+.. versionchanged:: 2.1
+
+ Older versions don't accept a tuple.
+
``name``
--------