summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJorge C. Leitão <jorgecarleitao@gmail.com>2014-06-16 21:30:26 +0200
committerTim Graham <timograham@gmail.com>2014-06-18 12:30:10 -0400
commitde9012907063e210e97c0d65cde312ff6174d420 (patch)
tree3e7c7e1acaa0edaa66081e61b8f7c7b46e69dec1 /docs
parentd015c9d11cd59491ddf9105f05a41ad5af0243b0 (diff)
Fixed #14481 -- Documented implicit "through" class created by ManyToManyField.
Thanks to jonathanmorgan for the report and initial patch.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/models/fields.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt
index 5148c68c5d..94167967ff 100644
--- a/docs/ref/models/fields.txt
+++ b/docs/ref/models/fields.txt
@@ -1342,6 +1342,19 @@ that control how the relationship functions.
:ref:`extra data with a many-to-many relationship
<intermediary-manytomany>`.
+ If you don't specify an explicit ``through`` model, there is still an
+ implicit ``through`` model class you can use to directly access the table
+ created to hold the association. It has three fields:
+
+ * ``id``: the primary key of the relation.
+ * ``<containing_model>_id``: the ``id`` of the model that declares the
+ ``ManyToManyField``.
+ * ``<other_model>_id``: the ``id`` of the model that the
+ ``ManyToManyField`` points to.
+
+ This class can be used to query associated records for a given model
+ instance like a normal model.
+
.. attribute:: ManyToManyField.through_fields
.. versionadded:: 1.7