undocumentet poll results

This commit is contained in:
Oskar Hahn 2011-09-09 16:18:17 +02:00
parent 475b7a1ffe
commit 7be90c89c7

View File

@ -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")