fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
clean dev
[wolnelektury.git]
/
src
/
polls
/
models.py
diff --git
a/src/polls/models.py
b/src/polls/models.py
index
8e35668
..
bfc3639
100644
(file)
--- a/
src/polls/models.py
+++ b/
src/polls/models.py
@@
-49,7
+49,7
@@
class PollItem(models.Model):
class Meta:
verbose_name = _('vote item')
verbose_name_plural = _('vote items')
class Meta:
verbose_name = _('vote item')
verbose_name_plural = _('vote items')
-
\r
+
def __unicode__(self):
return self.content + ' @ ' + unicode(self.poll)
def __unicode__(self):
return self.content + ' @ ' + unicode(self.poll)
@@
-58,7
+58,7
@@
class PollItem(models.Model):
return (float(self.vote_count) / self.poll.vote_count) * 100 if self.poll.vote_count else 0
def vote(self, session):
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()
self.save()
session.setdefault(USED_POLLS_KEY, []).append(self.poll.id)
session.save()