diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/checks.txt | 18 | ||||
| -rw-r--r-- | docs/ref/migration-operations.txt | 2 | ||||
| -rw-r--r-- | docs/ref/models/options.txt | 23 | ||||
| -rw-r--r-- | docs/ref/schema-editor.txt | 5 | ||||
| -rw-r--r-- | docs/releases/1.11.txt | 4 | ||||
| -rw-r--r-- | docs/releases/1.5.txt | 3 | ||||
| -rw-r--r-- | docs/releases/1.7.txt | 4 | ||||
| -rw-r--r-- | docs/releases/4.1.txt | 4 | ||||
| -rw-r--r-- | docs/releases/4.2.txt | 5 | ||||
| -rw-r--r-- | docs/releases/5.1.txt | 2 |
10 files changed, 24 insertions, 46 deletions
diff --git a/docs/ref/checks.txt b/docs/ref/checks.txt index 72699ac136..e641c989e3 100644 --- a/docs/ref/checks.txt +++ b/docs/ref/checks.txt @@ -345,21 +345,23 @@ Models ``<field name>`` from model ``<model>``. * **models.E007**: Field ``<field name>`` has column name ``<column name>`` that is used by another field. -* **models.E008**: ``index_together`` must be a list or tuple. +* **models.E008**: ``index_together`` must be a list or tuple. *This check + appeared before Django 5.1.* * **models.E009**: All ``index_together`` elements must be lists or tuples. + *This check appeared before Django 5.1.* * **models.E010**: ``unique_together`` must be a list or tuple. * **models.E011**: All ``unique_together`` elements must be lists or tuples. -* **models.E012**: ``constraints/indexes/index_together/unique_together`` - refers to the nonexistent field ``<field name>``. -* **models.E013**: ``constraints/indexes/index_together/unique_together`` - refers to a ``ManyToManyField`` ``<field name>``, but ``ManyToManyField``\s - are not supported for that option. +* **models.E012**: ``constraints/indexes/unique_together`` refers to the + nonexistent field ``<field name>``. +* **models.E013**: ``constraints/indexes/unique_together`` refers to a + ``ManyToManyField`` ``<field name>``, but ``ManyToManyField``\s are not + supported for that option. * **models.E014**: ``ordering`` must be a tuple or list (even if you want to order by only one field). * **models.E015**: ``ordering`` refers to the nonexistent field, related field, or lookup ``<field name>``. -* **models.E016**: ``constraints/indexes/index_together/unique_together`` - refers to field ``<field_name>`` which is not local to model ``<model>``. +* **models.E016**: ``constraints/indexes/unique_together`` refers to field + ``<field_name>`` which is not local to model ``<model>``. * **models.E017**: Proxy model ``<model>`` contains model fields. * **models.E018**: Autogenerated column name too long for field ``<field>``. Maximum length is ``<maximum length>`` for database ``<alias>``. diff --git a/docs/ref/migration-operations.txt b/docs/ref/migration-operations.txt index 7cc3a3926f..e8d8630851 100644 --- a/docs/ref/migration-operations.txt +++ b/docs/ref/migration-operations.txt @@ -247,7 +247,7 @@ Removes the index named ``name`` from the model with ``model_name``. Renames an index in the database table for the model with ``model_name``. Exactly one of ``old_name`` and ``old_fields`` can be provided. ``old_fields`` is an iterable of the strings, often corresponding to fields of -:attr:`~django.db.models.Options.index_together`. +``index_together`` (pre-Django 5.1 option). On databases that don't support an index renaming statement (SQLite and MariaDB < 10.5.2), the operation will drop and recreate the index, which can be diff --git a/docs/ref/models/options.txt b/docs/ref/models/options.txt index 2a383b2b88..909577be6c 100644 --- a/docs/ref/models/options.txt +++ b/docs/ref/models/options.txt @@ -451,29 +451,6 @@ not be looking at your Django code. For example:: The ``ValidationError`` raised during model validation when the constraint is violated has the ``unique_together`` error code. -``index_together`` ------------------- - -.. attribute:: Options.index_together - - Sets of field names that, taken together, are indexed:: - - index_together = [ - ["pub_date", "deadline"], - ] - - This list of fields will be indexed together (i.e. the appropriate - ``CREATE INDEX`` statement will be issued.) - - For convenience, ``index_together`` can be a single list when dealing with a single - set of fields:: - - index_together = ["pub_date", "deadline"] - - .. deprecated:: 4.2 - - Use the :attr:`~Options.indexes` option instead. - ``constraints`` --------------- diff --git a/docs/ref/schema-editor.txt b/docs/ref/schema-editor.txt index 635272c982..b459e646bc 100644 --- a/docs/ref/schema-editor.txt +++ b/docs/ref/schema-editor.txt @@ -114,9 +114,8 @@ the new value. .. method:: BaseDatabaseSchemaEditor.alter_index_together(model, old_index_together, new_index_together) -Changes a model's :attr:`~django.db.models.Options.index_together` value; this -will add or remove indexes from the model's table until they match the new -value. +Changes a model's ``index_together`` value; this will add or remove indexes +from the model's table until they match the new value. ``alter_db_table()`` -------------------- diff --git a/docs/releases/1.11.txt b/docs/releases/1.11.txt index 74db5fcf0d..a178257cd0 100644 --- a/docs/releases/1.11.txt +++ b/docs/releases/1.11.txt @@ -59,8 +59,8 @@ creating database indexes. Indexes are added to models using the The :class:`~django.db.models.Index` class creates a b-tree index, as if you used :attr:`~django.db.models.Field.db_index` on the model field or -:attr:`~django.db.models.Options.index_together` on the model ``Meta`` class. -It can be subclassed to support different index types, such as +``index_together`` on the model ``Meta`` class. It can be subclassed to support +different index types, such as :class:`~django.contrib.postgres.indexes.GinIndex`. It also allows defining the order (ASC/DESC) for the columns of the index. diff --git a/docs/releases/1.5.txt b/docs/releases/1.5.txt index 09284e6b35..76d41a9ab8 100644 --- a/docs/releases/1.5.txt +++ b/docs/releases/1.5.txt @@ -329,8 +329,7 @@ Django 1.5 also includes several smaller improvements worth noting: session data in a non-default cache. * Multi-column indexes can now be created on models. Read the - :attr:`~django.db.models.Options.index_together` documentation for more - information. + ``index_together`` documentation for more information. * During Django's logging configuration verbose Deprecation warnings are enabled and warnings are captured into the logging system. Logged warnings diff --git a/docs/releases/1.7.txt b/docs/releases/1.7.txt index e311e902d8..87246be6e4 100644 --- a/docs/releases/1.7.txt +++ b/docs/releases/1.7.txt @@ -778,8 +778,8 @@ 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. +* You can use a single list for ``index_together`` (rather than a list of + lists) when specifying a single set of fields. * Custom intermediate models having more than one foreign key to any of the models participating in a many-to-many relationship are now permitted, diff --git a/docs/releases/4.1.txt b/docs/releases/4.1.txt index d93833b7f7..c840db4a7f 100644 --- a/docs/releases/4.1.txt +++ b/docs/releases/4.1.txt @@ -317,7 +317,7 @@ Migrations * The new :class:`~django.db.migrations.operations.RenameIndex` operation allows renaming indexes defined in the :attr:`Meta.indexes <django.db.models.Options.indexes>` or - :attr:`~django.db.models.Options.index_together` options. + ``index_together`` options. * The migrations autodetector now generates :class:`~django.db.migrations.operations.RenameIndex` operations instead of @@ -327,7 +327,7 @@ Migrations * The migrations autodetector now generates :class:`~django.db.migrations.operations.RenameIndex` operations instead of ``AlterIndexTogether`` and ``AddIndex``, when moving indexes defined in the - :attr:`Meta.index_together <django.db.models.Options.index_together>` to the + ``Meta.index_together`` to the :attr:`Meta.indexes <django.db.models.Options.indexes>`. Models diff --git a/docs/releases/4.2.txt b/docs/releases/4.2.txt index 7d7848708d..0a52f3c813 100644 --- a/docs/releases/4.2.txt +++ b/docs/releases/4.2.txt @@ -477,9 +477,8 @@ Features deprecated in 4.2 ``index_together`` option is deprecated in favor of ``indexes`` --------------------------------------------------------------- -The :attr:`Meta.index_together <django.db.models.Options.index_together>` -option is deprecated in favor of the :attr:`~django.db.models.Options.indexes` -option. +The ``Meta.index_together`` option is deprecated in favor of the +:attr:`~django.db.models.Options.indexes` option. Migrating existing ``index_together`` should be handled as a migration. For example:: diff --git a/docs/releases/5.1.txt b/docs/releases/5.1.txt index 4560e1fabf..c8d6f5f3f6 100644 --- a/docs/releases/5.1.txt +++ b/docs/releases/5.1.txt @@ -252,3 +252,5 @@ See :ref:`deprecated-features-4.2` for details on these changes, including how to remove usage of these features. * The ``BaseUserManager.make_random_password()`` method is removed. + +* The model's ``Meta.index_together`` option is removed. |
