mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #10913 -- Documented how related_name affects QuerySet filtering
Thanks neithere for the suggestion.
This commit is contained in:
parent
e1b7723817
commit
75bb6ba966
2 changed files with 13 additions and 10 deletions
|
@ -1078,10 +1078,11 @@ define the details of how the relation works.
|
|||
.. attribute:: ForeignKey.related_name
|
||||
|
||||
The name to use for the relation from the related object back to this one.
|
||||
See the :ref:`related objects documentation <backwards-related-objects>` for
|
||||
a full explanation and example. Note that you must set this value
|
||||
when defining relations on :ref:`abstract models
|
||||
<abstract-base-classes>`; and when you do so
|
||||
It's also the default value for :attr:`related_query_name` (the name to use
|
||||
for the reverse filter name from the target model). See the :ref:`related
|
||||
objects documentation <backwards-related-objects>` for a full explanation
|
||||
and example. Note that you must set this value when defining relations on
|
||||
:ref:`abstract models <abstract-base-classes>`; and when you do so
|
||||
:ref:`some special syntax <abstract-related-name>` is available.
|
||||
|
||||
If you'd prefer Django not to create a backwards relation, set
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue