Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
django-taggit
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
288b794b
authored
Sep 17, 2010
by
Alex Gaynor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refs #39, document that aggregates do not work with taggit.
parent
543471cd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
8 deletions
+16
-8
docs/api.txt
+15
-6
docs/changelog.txt
+1
-2
No files found.
docs/api.txt
View file @
288b794b
...
...
@@ -19,23 +19,23 @@ playing around with the API.
Removes a tag from an object. No exception is raised if the object
doesn't have that tag.
.. method:: clear()
Removes all tags from an object.
.. method:: set(*tags)
Removes all the current tags and then adds the specified tags to the
object.
.. method: most_common()
Returns a ``QuerySet`` of all tags, annotated with the number of times
they appear, available as the ``num_times`` attribute on each tag. The
``QuerySet``is ordered by ``num_times``, descending. The ``QuerySet``
is lazily evaluated, and can be sliced efficiently.
.. method:: similar_objects()
Returns a list (not a lazy ``QuerySet``) of other objects tagged
...
...
@@ -63,7 +63,7 @@ like so::
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__name__in=["delicious", "red"])
[<Food: apple>, <Food: apple>]
>>> Food.objects.filter(tags__name__in=["delicious", "red"]).distinct()
...
...
@@ -71,3 +71,12 @@ make use of the ``distinct()`` method on ``QuerySets``::
You can also filter by the slug on tags. If you're using a custom ``Tag``
model you can use this API to filter on any fields it has.
Aggregation
~~~~~~~~~~~
Unfortunately, due to a
`bug in Django <http://code.djangoproject.com/ticket/10870>`_, it is not
currently possible to use aggregation in conjunction with ``taggit``. This is
a `documented interaction <http://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#generic-relations-and-aggregation>`_
of generic relations (which ``taggit`` uses internally) and aggregates.
docs/changelog.txt
View file @
288b794b
...
...
@@ -19,7 +19,7 @@ Unreleased.
0.8.0
~~~~~
* Fixed querying for objects using ``exclude(tags__in=tags)``.
* Marked strings as translatable.
...
...
@@ -34,4 +34,3 @@ Unreleased.
transaction with an ``IntegrityError``.
* Added Python 2.4 compatibility.
* Added Django 1.1 compatibility.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment