class Meta:
verbose_name = _('vote item')
verbose_name_plural = _('vote items')
-\r
+
def __unicode__(self):
return self.content + ' @ ' + unicode(self.poll)
return (float(self.vote_count) / self.poll.vote_count) * 100 if self.poll.vote_count else 0
def vote(self, session):
- self.vote_count = self.vote_count + 1
+ self.vote_count += 1
self.save()
session.setdefault(USED_POLLS_KEY, []).append(self.poll.id)
session.save()