diff options
| author | James Bennett <ubernostrum@gmail.com> | 2008-08-01 04:38:55 +0000 |
|---|---|---|
| committer | James Bennett <ubernostrum@gmail.com> | 2008-08-01 04:38:55 +0000 |
| commit | 74927cd87eaf9bd2fe8fd8d23180f46a3c5d9fa7 (patch) | |
| tree | 4575ab296dd45f66c913a8d07c8c1ff7b2f0f7c5 /docs | |
| parent | c1f5da90a5596a238017b242e698d14d6e71e796 (diff) | |
Clarify the m2m intermediary docs a bit.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8167 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/model-api.txt | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/docs/model-api.txt b/docs/model-api.txt index 616cd1d242..9b3132e082 100644 --- a/docs/model-api.txt +++ b/docs/model-api.txt @@ -1000,9 +1000,17 @@ There are a few restrictions on the intermediate model: * Your intermediate model must contain one - and *only* one - foreign key on the source model (this would be ``Group`` in our example). If you have more than one foreign key, a validation error will be raised. - - * If the many-to-many relation is a relation on itself, the relationship - must be non-symmetric. + + * The only exception to this is a model which has a many-to-many + relationship to itself, through an intermediary model. In this + case, two foreign keys to the same model are permitted, but they + will be treated as the two (different) sides of the many-to-many + relation. + + * When defining a many-to-many relationship from a model to + itself, using an intermediary model, you *must* use + ``symmetrical=False`` (see the documentation for + ``ManyToManyField`` above). Now that you have set up your ``ManyToManyField`` to use your intermediary model (Membership, in this case), you're ready to start creating some |
