1
0
mirror of https://github.com/django/django.git synced 2025-10-29 08:36:09 +00:00

Fixed #11795 -- Document (and slightly simplify) the use of inlines for m2m relations.

This is the first immediate benefit of m2m relations having an autogenerated model.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@11712 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2009-11-03 15:02:16 +00:00
parent 53b2c3867b
commit dab3e97c1a
2 changed files with 62 additions and 7 deletions

View File

@@ -586,6 +586,9 @@ class ReverseManyRelatedObjectsDescriptor(object):
# ReverseManyRelatedObjectsDescriptor instance.
def __init__(self, m2m_field):
self.field = m2m_field
# through is provided so that you have easy access to the through
# model (Book.authors.through) for inlines, etc.
self.through = m2m_field.rel.through
def __get__(self, instance, instance_type=None):
if instance is None: