Is there a way to calculate and store the average rating in this
example:
RATING_CHOICES = {
'3' : 'Excellent',
'2' : 'Good',
'1' : 'Poor',
}
class Loan(....
...
book = models.ForeignKey(Book)
rating = models.IntegerField(choices=RATING_CHOICES)
...
class BookRatings(...
...
book = models.ForeignKey(Book)
rating = models.IntegerField(...here I would like the average rating
from the Loan model...)
nums = models.IntegerField(...and here the number of ratings
done...)
...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---