Package django :: Package contrib :: Package comments :: Module models :: Class CommentManager
[hide private]
[frames] | no frames]

Class CommentManager

source code

db.models.Manager --+
                    |
                   CommentManager

Instance Methods [hide private]
 
get_security_hash(self, options, photo_options, rating_options, target)
Returns the MD5 hash of the given options (a comma-separated string such as 'pa,ra') and target (something like 'lcom.eventtimes:5157').
source code
 
get_rating_options(self, rating_string)
Given a rating_string, this returns a tuple of (rating_range, options).
source code
 
get_list_with_karma(self, **kwargs)
Returns a list of Comment objects matching the given lookup terms, with _karma_total_good and _karma_total_bad filled.
source code
 
user_is_moderator(self, user) source code
Method Details [hide private]

get_security_hash(self, options, photo_options, rating_options, target)

source code 

Returns the MD5 hash of the given options (a comma-separated string such as 'pa,ra') and target (something like 'lcom.eventtimes:5157'). Used to validate that submitted form options have not been tampered-with.

get_rating_options(self, rating_string)

source code 

Given a rating_string, this returns a tuple of (rating_range, options). >>> s = "scale:1-10|First_category|Second_category" >>> Comment.objects.get_rating_options(s) ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], ['First category', 'Second category'])