diff options
| author | Simon Meers <simon@simonmeers.com> | 2010-10-09 02:57:11 +0000 |
|---|---|---|
| committer | Simon Meers <simon@simonmeers.com> | 2010-10-09 02:57:11 +0000 |
| commit | 52e781290174b71b37e4675ff504edc612ea66e8 (patch) | |
| tree | 870cbeea626c980f5c84f8bce8c7f7908605ca62 /docs/ref | |
| parent | 5ff085d65ed87793e06c94569c79ef41e7c4afcc (diff) | |
[1.2.X] Fixed #5537 -- document trailing '+' on related_name for supressing 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
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/models/fields.txt | 9 |
1 files changed, 9 insertions, 0 deletions
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. <abstract-base-classes>`; and when you do so :ref:`some special syntax <abstract-related-name>` 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 |
