Commit 2133f1b1 by Alex Gaynor

Added an example of filtering to the docs, thanks to James Tauber for pointing this out

parent 5518db1d
......@@ -51,3 +51,11 @@ object.
If using generic tagging (the default), this method searches all tagged
objects. If querying on a model with its own tagging through table, only other
instances of the same model will be returned.
Filtering
~~~~~~~~~
To find all of a model with a specific tags you can filter, using the normal Django ORM API. For example if you had a ``Food`` model, who's ``TaggableManager`` was named ``tags``, you could find all the delicious fruit like so::
>>> Food.objects.filter(tags__in=["delicious"])
[<Food: apple>, <Food: pear>, <Food: plum>]
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