summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Yancey <jeffrey.yancey@gmail.com>2018-06-28 14:39:42 -0400
committerTim Graham <timograham@gmail.com>2018-06-28 20:02:21 -0400
commitddd9272c2e323b4e8937774425ee93ebebf8eeba (patch)
treec479ed752ba7874d3a59d4d4d8c5d578eb6d7f74
parentc2d44ae6cbed9fdee52ec6d15bec1ca273866d32 (diff)
[2.1.x] Fixed #29458 -- Doc'd how related_query_name affects Model._meta.get_field().
Backport of 2d6776ffe0b58f729f4372635b49a59da99ca206 from master
-rw-r--r--AUTHORS1
-rw-r--r--docs/ref/models/meta.txt5
2 files changed, 4 insertions, 2 deletions
diff --git a/AUTHORS b/AUTHORS
index 4ac99db75e..8319e84ece 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -381,6 +381,7 @@ answer newbie questions, and generally made Django that much better:
Jeff Hui <jeffkhui@gmail.com>
Jeffrey Gelens <jeffrey@gelens.org>
Jeff Triplett <jeff.triplett@gmail.com>
+ Jeffrey Yancey <jeffrey.yancey@gmail.com>
Jens Diemer <django@htfx.de>
Jens Page
Jensen Cochran <jensen.cochran@gmail.com>
diff --git a/docs/ref/models/meta.txt b/docs/ref/models/meta.txt
index b63305d427..8adf719e16 100644
--- a/docs/ref/models/meta.txt
+++ b/docs/ref/models/meta.txt
@@ -33,8 +33,9 @@ Retrieving a single field instance of a model by name
``field_name`` can be the name of a field on the model, a field
on an abstract or inherited model, or a field defined on another
model that points to the model. In the latter case, the ``field_name``
- will be the ``related_name`` defined by the user or the name automatically
- generated by Django itself.
+ will be (in order of preference) the :attr:`~.ForeignKey.related_query_name`
+ set by the user, the :attr:`~.ForeignKey.related_name` set by the user, or
+ the name automatically generated by Django.
:attr:`Hidden fields <django.db.models.Field.hidden>` cannot be retrieved
by name.