Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {% for choice in choices %}
- {{choice.choice}} - {{votes[choice.id]}} <br />
- {% endfor %}
- class Choice(models.Model):
- text = models.CharField(max_length=200)
- def calculateVotes(self):
- return Vote.objects.filter(choice = self).count()
- votes = property(calculateVotes)
- {% for choice in choices %}
- {{choice.choice}} - {{choice.votes}} <br />
- {% endfor %}
Add Comment
Please, Sign In to add comment