Fix initial value for pollform is value is a "special" value (#135)

This commit is contained in:
Andy Kittner 2012-05-19 14:19:32 +02:00
parent 182f20308b
commit fbc603b748
2 changed files with 4 additions and 2 deletions

View File

@ -28,7 +28,7 @@ class OptionForm(forms.Form, CssClassMixin):
if type(vote) is Vote:
key = vote.value
value = vote.get_value()
weight = vote.get_weight()
weight = vote.get_weight(raw = True)
else:
key = vote
value = _(vote)

View File

@ -36,7 +36,9 @@ class Vote(models.Model):
weight = models.IntegerField(default=1)
value = models.CharField(max_length=255, null=True)
def get_weight(self):
def get_weight(self, raw = False):
if raw:
return self.weight
return print_value(self.weight)
def get_value(self):