Kaydet (Commit) af67b93c authored tarafından Matthew Rich's avatar Matthew Rich

re-indented method documentation within RelatedManager

üst a5bcc09c
......@@ -36,12 +36,7 @@ Related objects reference
In this example, the methods below will be available both on
``topping.pizza_set`` and on ``pizza.toppings``.
.. _related-manager-methods:
Related Manager Methods
-----------------------
.. method:: add(obj1, [obj2, ...])
.. method:: add(obj1, [obj2, ...])
Adds the specified model objects to the related object set.
......@@ -61,7 +56,7 @@ Related Manager Methods
some custom logic when a relationship is created, listen to the
:data:`~django.db.models.signals.m2m_changed` signal.
.. method:: create(**kwargs)
.. method:: create(**kwargs)
Creates a new object, saves it and puts it in the related object set.
Returns the newly created object::
......@@ -91,7 +86,7 @@ Related Manager Methods
parameter ``blog`` to ``create()``. Django figures out that the new
``Entry`` object's ``blog`` field should be set to ``b``.
.. method:: remove(obj1, [obj2, ...])
.. method:: remove(obj1, [obj2, ...])
Removes the specified model objects from the related object set::
......@@ -115,7 +110,7 @@ Related Manager Methods
the ``blog`` :class:`~django.db.models.ForeignKey` doesn't have
``null=True``, this is invalid.
.. method:: clear()
.. method:: clear()
Removes all objects from the related object set::
......@@ -128,7 +123,7 @@ Related Manager Methods
Just like ``remove()``, ``clear()`` is only available on
:class:`~django.db.models.ForeignKey`\s where ``null=True``.
.. note::
.. note::
Note that ``add()``, ``create()``, ``remove()``, and ``clear()`` all
apply database changes immediately for all types of related fields. In other
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment