Skip to content
Browse files

Documented new helper method and tags

git-svn-id: https://django-voting.googlecode.com/svn/trunk@26 662f01ad-f42a-0410-a340-718c64ddaef4
  • Loading branch information...
1 parent ec97ee7 commit b41c19bfcab60f8ddaa4710c8812c933c5f76ecf @insin insin committed Mar 14, 2007
Showing with 30 additions and 0 deletions.
  1. +30 −0 README.txt
View
30 README.txt
@@ -99,6 +99,11 @@ functions:
object by the given user, or ``None`` if no matching vote
exists.
+ * ``get_for_user_in_bulk(objects, user)`` -- Gets the votes
+ made on all the given objects by the given user.
+
+ Returns a dictionary mapping object ids to votes.
+
Basic usage
-----------
@@ -318,6 +323,31 @@ Example usage::
{% vote_by_user user widget as vote %}
+votes_by_user
+~~~~~~~~~~~~~
+
+Retrieves the votes cast by a user on a list of objects as a
+dictionary keyed with object ids and stores it in a context
+variable.
+
+Example usage::
+
+ {% votes_by_user user widget_list as vote_dict %}
+
+vote_for_item
+~~~~~~~~~~~~~
+
+Given an object and a dictionary mapping object ids to votes - as
+returned, for example, by the votes_by_user template tag - retrieves
+the vote for the given object and stores it in a context variable,
+or ``None`` if no vote exists for the given object.
+
+Yes, it's a dictionary lookup tag by another name :p
+
+Example usage::
+
+ {% vote_for_item object from vote_dict as vote %}
+
confirm_vote_message
~~~~~~~~~~~~~~~~~~~~

0 comments on commit b41c19b

Please sign in to comment.
Something went wrong with that request. Please try again.