From fa3335fa9f5af4b1ff3991b87ebac3449ceae6b2 Mon Sep 17 00:00:00 2001 From: Simon Meers Date: Sat, 9 Oct 2010 02:54:48 +0000 Subject: [PATCH] Fixed #5537 -- document trailing '+' on related_name for supressing backward relation. Thanks to dcramer for the report, and Russ for pointing out the workaround. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14049 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/ref/models/fields.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt index 68208b3bfe..a390b4b843 100644 --- a/docs/ref/models/fields.txt +++ b/docs/ref/models/fields.txt @@ -925,6 +925,15 @@ define the details of how the relation works. `; and when you do so :ref:`some special syntax ` is available. + If you wish to supress the provision of a backwards relation, you may + simply provide a ``related_name`` which ends with a '+' character. + For example:: + + user = models.ForeignKey(User, related_name='+') + + will ensure that no backwards relation to this model is provided on the + ``User`` model. + .. attribute:: ForeignKey.to_field The field on the related object that the relation is to. By default, Django