i am using django ratings application
into this fields.py module,i added new function to RatingManager class which is get_bayesian see below
http://github.com/dcramer/django-ratings/blob/master/djangoratings/fields.py
def get_real_rating(self):
"""get_rating()
Returns the unmodified average rating."""
if not (self.votes and self.score):
return 0
return float(self.score)/self.votes
i added this method to code
#def get_bayesian(self):
return 6
#
def get_rating_for_user(self, user, ip_address=None):
"""get_rating_for_user(user, ip_address=None)
Returns the rating for a user or anonymous IP."""
kwargs = dict(
content_type = self.get_content_type(),
object_id = self.instance.pk,
key = self.field.key,
)
i can't get any result when i call that function from my template all other functions are ok in template such as get_percent etc
below is template code
Score: {{profile.rating.score}}
Votes: {{profile.rating.votes}}
Real Percent: {{profile.rating.get_real_percent|floatformat}}
Percent: {{profile.rating.get_percent|floatformat}}
this call is not returning any result
Bayesian: {{profile.rating.get_bayesian|floatformat}}