summaryrefslogtreecommitdiff
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:39:36 -0400
commit6b52e1793c682d4f9c8f030dcbe6908ddddf875e (patch)
treee10b8a17d0240c3daa3f356d56d6f31ee8bc992b
parentb0e5a527dbd2f242fa59fa8f40b7f2de4d55d57a (diff)
[1.6.x] Fixed #14481 -- Documented implicit "through" class created by ManyToManyField.
Thanks to jonathanmorgan for the report and initial patch. Backport of de90129070 from master
-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 d70f6c7e8f..bda884697c 100644
--- a/docs/ref/models/fields.txt
+++ b/docs/ref/models/fields.txt
@@ -1280,6 +1280,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.db_table
The name of the table to create for storing the many-to-many data. If this