From 7be90c89c759cb4e190d3ceae927ec36413b8501 Mon Sep 17 00:00:00 2001
From: Oskar Hahn
Date: Fri, 9 Sep 2011 16:18:17 +0200
Subject: [PATCH 1/2] 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")
From 7fc12e51f94515ddb69669044144556ffd0e431f Mon Sep 17 00:00:00 2001
From: Oskar Hahn
Date: Fri, 9 Sep 2011 16:26:34 +0200
Subject: [PATCH 2/2] type in last commit, template update, form update
info in template, that -1 is majority and -2 in undocumentet
update option_form. -2 is a valide value
---
openslides/assignment/templates/assignment/poll_view.html | 5 +++--
openslides/poll/forms.py | 6 +++---
openslides/poll/models.py | 6 +++---
3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/openslides/assignment/templates/assignment/poll_view.html b/openslides/assignment/templates/assignment/poll_view.html
index 33f6bd871..10bdb38a3 100644
--- a/openslides/assignment/templates/assignment/poll_view.html
+++ b/openslides/assignment/templates/assignment/poll_view.html
@@ -7,6 +7,7 @@
{% blocktrans count counter=options|length %}candidate{% plural %}candidates{% endblocktrans %}
{% trans "Short description" %}: {{ poll.description }}
+ -1 := {% trans 'majority' %}, -2 := {% trans 'undocumented' %}