From 7be90c89c759cb4e190d3ceae927ec36413b8501 Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Fri, 9 Sep 2011 16:18:17 +0200 Subject: [PATCH] undocumentet poll results --- openslides/poll/models.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/openslides/poll/models.py b/openslides/poll/models.py index d3ffdc578..735cf51dc 100644 --- a/openslides/poll/models.py +++ b/openslides/poll/models.py @@ -71,7 +71,7 @@ class Poll(models.Model): if self.assignment: return Poll.objects.filter(assignment=self.assignment).count() return None - + @property def ballot(self): if self.application: @@ -125,6 +125,8 @@ class Option(models.Model): def yes(self): if self.voteyes == -1: return _('majority') + if self.voteno == -2: + return _('undocumented') if self.voteyes: return self.voteyes return '0' @@ -133,6 +135,8 @@ class Option(models.Model): def no(self): if self.voteno == -1: return _('majority') + if self.voteno == -2: + return _('undocumented') if self.voteno: return self.voteno return '0' @@ -141,6 +145,8 @@ class Option(models.Model): def undesided(self): if self.voteundesided == -1: return _('majority') + if self.voteno == -2: + return _('undocumented') if self.voteundesided: return self.voteundesided return '0' @@ -156,10 +162,6 @@ class Option(models.Model): return None def __unicode__(self): - if self.text != "" and self.text is not None: - return self.text - if self.user is not None: - return unicode(self.user) - if self.application is not None: - return unicode(self.application) + if self.value: + return self.value return _("No options")