Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Clarify the m2m intermediary docs a bit.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8167 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 74927cd87eaf9bd2fe8fd8d23180f46a3c5d9fa7 1 parent c1f5da9
James Bennett authored

Showing 1 changed file with 11 additions and 3 deletions. Show diff stats Hide diff stats

  1. 14  docs/model-api.txt
14  docs/model-api.txt
@@ -1000,9 +1000,17 @@ There are a few restrictions on the intermediate model:
1000 1000
     * Your intermediate model must contain one - and *only* one - foreign key 
1001 1001
       on the source model (this would be ``Group`` in our example). If you
1002 1002
       have more than one foreign key, a validation error will be raised.
1003  
-      
1004  
-    * If the many-to-many relation is a relation on itself, the relationship
1005  
-      must be non-symmetric.
  1003
+
  1004
+    * The only exception to this is a model which has a many-to-many
  1005
+      relationship to itself, through an intermediary model. In this
  1006
+      case, two foreign keys to the same model are permitted, but they
  1007
+      will be treated as the two (different) sides of the many-to-many
  1008
+      relation.
  1009
+    
  1010
+    * When defining a many-to-many relationship from a model to
  1011
+      itself, using an intermediary model, you *must* use
  1012
+      ``symmetrical=False`` (see the documentation for
  1013
+      ``ManyToManyField`` above).
1006 1014
 
1007 1015
 Now that you have set up your ``ManyToManyField`` to use your intermediary 
1008 1016
 model (Membership, in this case), you're ready to start creating some

0 notes on commit 74927cd

Please sign in to comment.
Something went wrong with that request. Please try again.