1
0
mirror of https://github.com/django/django.git synced 2025-03-28 18:20:49 +00:00

[1.6.x] Fixed -- Documented implicit "through" class created by ManyToManyField.

Thanks to jonathanmorgan for the report and initial patch.

Backport of de90129070 from master
This commit is contained in:
Jorge C. Leitão 2014-06-16 21:30:26 +02:00 committed by Tim Graham
parent b0e5a527db
commit 6b52e1793c

@ -1280,6 +1280,19 @@ that control how the relationship functions.
:ref:`extra data with a many-to-many relationship :ref:`extra data with a many-to-many relationship
<intermediary-manytomany>`. <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 .. attribute:: ManyToManyField.db_table
The name of the table to create for storing the many-to-many data. If this The name of the table to create for storing the many-to-many data. If this