Ticket #14840: link-related-objects.diff

File link-related-objects.diff, 2.3 KB (added by Adam Vandenberg, 14 years ago)
  • docs/ref/models/relations.txt

    diff --git a/docs/ref/models/relations.txt b/docs/ref/models/relations.txt
    index 8a34c19..ee6bcdd 100644
    a b Related objects reference  
    99    A "related manager" is a manager used in a one-to-many or many-to-many
    1010    related context. This happens in two cases:
    1111
    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::
    1314
    1415                class Reporter(models.Model):
    1516                    ...
    Related objects reference  
    2021          In the above example, the methods below will be available on
    2122          the manager ``reporter.article_set``.
    2223
    23         * Both sides of a ``ManyToManyField`` relation::
     24        * Both sides of a :class:`~django.db.models.ManyToManyField` relation::
    2425
    2526                class Topping(models.Model):
    2627                    ...
    Related objects reference  
    8283            >>> b.entry_set.remove(e) # Disassociates Entry e from Blog b.
    8384
    8485        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
    9092        is invalid.
    9193
    9294    .. method:: clear()
    Related objects reference  
    100102        them.
    101103
    102104        Just like ``remove()``, ``clear()`` is only available on
    103         ``ForeignKey``\s where ``null=True``.
     105        :class:`~django.db.models.ForeignKey`\s where ``null=True``.
Back to Top