Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #14840 -- Added crossrefs to related objects reference docs. Th…

…anks to adamv for the report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14842 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit b407de3bc56f2676bca214a302b1ea7d64b16d6b 1 parent 0f5a7e0
authored December 06, 2010

Showing 1 changed file with 10 additions and 8 deletions. Show diff stats Hide diff stats

  1. 18  docs/ref/models/relations.txt
18  docs/ref/models/relations.txt
@@ -9,7 +9,8 @@ Related objects reference
9 9
     A "related manager" is a manager used in a one-to-many or many-to-many
10 10
     related context. This happens in two cases:
11 11
 
12  
-        * The "other side" of a ``ForeignKey`` relation. That is::
  12
+        * The "other side" of a :class:`~django.db.models.ForeignKey` relation.
  13
+          That is::
13 14
 
14 15
                 class Reporter(models.Model):
15 16
                     ...
@@ -20,7 +21,7 @@ Related objects reference
20 21
           In the above example, the methods below will be available on
21 22
           the manager ``reporter.article_set``.
22 23
 
23  
-        * Both sides of a ``ManyToManyField`` relation::
  24
+        * Both sides of a :class:`~django.db.models.ManyToManyField` relation::
24 25
 
25 26
                 class Topping(models.Model):
26 27
                     ...
@@ -82,11 +83,12 @@ Related objects reference
82 83
             >>> b.entry_set.remove(e) # Disassociates Entry e from Blog b.
83 84
 
84 85
         In order to prevent database inconsistency, this method only exists on
85  
-        ``ForeignKey`` objects where ``null=True``. If the related field can't
86  
-        be set to ``None`` (``NULL``), then an object can't be removed from a
87  
-        relation without being added to another. In the above example, removing
88  
-        ``e`` from ``b.entry_set()`` is equivalent to doing ``e.blog = None``,
89  
-        and because the ``blog`` ``ForeignKey`` doesn't have ``null=True``, this
  86
+        :class:`~django.db.models.ForeignKey` objects where ``null=True``. If
  87
+        the related field can't be set to ``None`` (``NULL``), then an object
  88
+        can't be removed from a relation without being added to another. In the
  89
+        above example, removing ``e`` from ``b.entry_set()`` is equivalent to
  90
+        doing ``e.blog = None``, and because the ``blog``
  91
+        :class:`~django.db.models.ForeignKey` doesn't have ``null=True``, this
90 92
         is invalid.
91 93
 
92 94
     .. method:: clear()
@@ -100,4 +102,4 @@ Related objects reference
100 102
         them.
101 103
 
102 104
         Just like ``remove()``, ``clear()`` is only available on
103  
-        ``ForeignKey``\s where ``null=True``.
  105
+        :class:`~django.db.models.ForeignKey`\s where ``null=True``.

0 notes on commit b407de3

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