summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAdam Johnson <me@adamj.eu>2024-02-16 22:04:02 +0000
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2024-02-17 19:22:20 +0100
commit23c7cbfd241bb4287d042e8634a9c27ed3b7490e (patch)
tree7781f4d0b60aecb8c9d119dd67261a41213c82de /docs
parent41a4bba817f139f3cfd94f04e728e046560c9a18 (diff)
[5.0.x] Fixed #28011 -- Corrected Field.hidden docs.
Backport of 7ba6c9edc50dc989fc5c306b541636249b952f93 from main
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/models/fields.txt17
-rw-r--r--docs/ref/models/meta.txt5
2 files changed, 6 insertions, 16 deletions
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt
index 2d13e96459..2607973d79 100644
--- a/docs/ref/models/fields.txt
+++ b/docs/ref/models/fields.txt
@@ -2500,18 +2500,11 @@ Attributes for fields
.. attribute:: Field.hidden
- Boolean flag that indicates if a field is used to back another non-hidden
- field's functionality (e.g. the ``content_type`` and ``object_id`` fields
- that make up a ``GenericForeignKey``). The ``hidden`` flag is used to
- distinguish what constitutes the public subset of fields on the model from
- all the fields on the model.
-
- .. note::
-
- :meth:`Options.get_fields()
- <django.db.models.options.Options.get_fields()>`
- excludes hidden fields by default. Pass in ``include_hidden=True`` to
- return hidden fields in the results.
+ Boolean flag that indicates if a field is hidden and should not be returned
+ by :meth:`Options.get_fields()
+ <django.db.models.options.Options.get_fields>` by default. An example is
+ the reverse field for a :class:`~django.db.models.ForeignKey` with a
+ ``related_name`` that starts with ``'+'``.
.. attribute:: Field.is_relation
diff --git a/docs/ref/models/meta.txt b/docs/ref/models/meta.txt
index a96c563d49..b3ec23f218 100644
--- a/docs/ref/models/meta.txt
+++ b/docs/ref/models/meta.txt
@@ -79,10 +79,7 @@ Retrieving all field instances of a model
``include_hidden``
``False`` by default. If set to ``True``, ``get_fields()`` will include
- fields that are used to back other field's functionality. This will
- also include any fields that have a ``related_name`` (such
- as :class:`~django.db.models.ManyToManyField`, or
- :class:`~django.db.models.ForeignKey`) that start with a "+".
+ :attr:`hidden fields <django.db.models.Field.hidden>`.
.. code-block:: pycon