Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.2.X] Fixed #5537 -- document trailing '+' on related_name for supr…

…essing backward relation.

Thanks to dcramer for the report, and Russ for pointing out the workaround.

Backport of r14049 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14050 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 52e781290174b71b37e4675ff504edc612ea66e8 1 parent 5ff085d
Simon Meers authored October 09, 2010

Showing 1 changed file with 9 additions and 0 deletions. Show diff stats Hide diff stats

  1. 9  docs/ref/models/fields.txt
9  docs/ref/models/fields.txt
@@ -925,6 +925,15 @@ define the details of how the relation works.
925 925
     <abstract-base-classes>`; and when you do so
926 926
     :ref:`some special syntax <abstract-related-name>` is available.
927 927
 
  928
+    If you wish to supress the provision of a backwards relation, you may
  929
+    simply provide a ``related_name`` which ends with a '+' character.
  930
+    For example::
  931
+   
  932
+        user = models.ForeignKey(User, related_name='+')
  933
+
  934
+    will ensure that no backwards relation to this model is provided on the 
  935
+    ``User`` model.
  936
+
928 937
 .. attribute:: ForeignKey.to_field
929 938
 
930 939
     The field on the related object that the relation is to. By default, Django

0 notes on commit 52e7812

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