Commit 8d20130c by Alex Gaynor

Fixed #34, appropriatlly document duplicate results.

parent 82e9c064
......@@ -61,4 +61,14 @@ Django ORM API. For example if you had a ``Food`` model, whose
like so::
>>> Food.objects.filter(tags__in=["delicious"])
[<Food: apple>, <Food: pear>, <Food: plum>]
[<Food: apple>, <Food: pear>, <Food: plum>]
If you're filtering on multiple tags, it's very common to get duplicate
results, because of the way relational databases work. Often you'll want to
make use of the ``distinct()`` method on ``QuerySets``::
>>> Food.objects.filter(tags__in=["delicious", "red"])
[<Food: apple>, <Food: apple>]
>>> Food.objects.filter(tags__in=["delicious", "red"]).distinct()
[<Food: apple>]
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 sign in to comment