Skip to content

Commit 6c8d010

Browse files
committed
remove expression indexes
1 parent d746448 commit 6c8d010

File tree

1 file changed

+1
-34
lines changed

1 file changed

+1
-34
lines changed

source/model-data/indexes.txt

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,7 @@ code:
7979

8080
To define your index, pass the following arguments to the ``models.Index()`` method:
8181

82-
- ``expressions``: Specifies a database expression to index. If you don't pass
83-
the ``fields`` argument, this argument is required. To learn more about this
84-
argument, see the :ref:`django-indexes-expressions` section of this guide.
85-
86-
- ``fields``: Specifies a list of fields to index. If you don't pass the
87-
``expressions`` argument, this argument is required.
82+
- ``fields``: Specifies a list of fields to index. This argument is required.
8883

8984
- ``name``: Specifies the index name. This argument is optional, and Django
9085
automatically creates an index name if you don't provide one.
@@ -204,7 +199,6 @@ index types:
204199

205200
- :ref:`django-indexes-partial`
206201
- :ref:`django-indexes-unique`
207-
- :ref:`django-indexes-expressions`
208202

209203
.. _django-indexes-partial:
210204

@@ -285,33 +279,6 @@ creates a unique compound index on these fields:
285279
class's ``constraint`` option, see `Constraints <{+django-docs+}/ref/models/constraints/>`__
286280
in the Django documentation.
287281

288-
.. _django-indexes-expressions:
289-
290-
Expression Indexes
291-
~~~~~~~~~~~~~~~~~~
292-
293-
To create indexes on expressions and database functions, pass the
294-
``expressions`` argument to the ``models.Index()`` method. When using
295-
the ``expressions`` argument, you must also pass the ``name``
296-
argument to ``models.Index()``.
297-
298-
The following example updates the ``Recipe`` model's ``Meta`` class to create
299-
an index on the sum of the ``cook_time`` and ``prep_time`` values:
300-
301-
.. literalinclude:: /includes/model-data/indexes.py
302-
:start-after: start-expression
303-
:end-before: end-expression
304-
:language: python
305-
:copyable:
306-
:emphasize-lines: 3-7
307-
308-
.. tip::
309-
310-
The preceding example uses ``F`` objects to create a database
311-
function. To learn more about ``F`` objects, see `F() expressions
312-
<{+django-docs+}/ref/models/expressions/#f-expressions>`__ in the Django
313-
documentation.
314-
315282
Additional Information
316283
----------------------
317284

0 commit comments

Comments
 (0)