@@ -718,12 +718,12 @@ The ``DoesNotExist`` exception inherits from
718718A convenience method for creating an object and saving it all in one step. Thus::
719719
720720 p = Person.objects.create(first_name="Bruce", last_name="Springsteen")
721-
721+
722722and::
723723
724724 p = Person(first_name="Bruce", last_name="Springsteen")
725725 p.save()
726-
726+
727727are equivalent.
728728
729729``get_or_create(**kwargs)``
@@ -1471,11 +1471,12 @@ the ``ForeignKey`` ``Manager`` has these additional methods:
14711471 b.entry_set.remove(e) # Disassociates Entry e from Blog b.
14721472
14731473 In order to prevent database inconsistency, this method only exists on
1474- ``ForeignKey``s where ``null=True``. If the related field can't be set to
1475- ``None`` (``NULL``), then an object can't be removed from a relation
1476- without being added to another. In the above example, removing ``e`` from
1477- ``b.entry_set()`` is equivalent to doing ``e.blog = None``, and because
1478- the ``blog`` ``ForeignKey`` doesn't have ``null=True``, this is invalid.
1474+ ``ForeignKey`` objects where ``null=True``. If the related field can't be
1475+ set to ``None`` (``NULL``), then an object can't be removed from a
1476+ relation without being added to another. In the above example, removing
1477+ ``e`` from ``b.entry_set()`` is equivalent to doing ``e.blog = None``,
1478+ and because the ``blog`` ``ForeignKey`` doesn't have ``null=True``, this
1479+ is invalid.
14791480
14801481 * ``clear()``: Removes all objects from the related object set.
14811482
@@ -1559,13 +1560,13 @@ Queries over related objects
15591560----------------------------
15601561
15611562Queries involving related objects follow the same rules as queries involving
1562- normal value fields. When specifying the the value for a query to match, you
1563- may use either an object instance itself, or the primary key value for the
1563+ normal value fields. When specifying the the value for a query to match, you
1564+ may use either an object instance itself, or the primary key value for the
15641565object.
15651566
15661567For example, if you have a Blog object ``b`` with ``id=5``, the following
15671568three queries would be identical::
1568-
1569+
15691570 Entry.objects.filter(blog=b) # Query using object instance
15701571 Entry.objects.filter(blog=b.id) # Query using id from instance
15711572 Entry.objects.filter(blog=5) # Query using id directly
0 commit comments