'Need help adding a count to the queryset model
Im trying to add a count to the following queryset code in django.
query.communityRating = int(query.communityRating) + value
query.communityCount = query.communityCount + 1
query.save()
and then when we pass the score, to the template
if query.communityRating != 0:
comRating = query.communityRating / query.communityCount
else:
comRating = query.communityRating
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
