Skip to content

Commit

Permalink
Merge pull request #12 from eldarion/fix-multiple-response
Browse files Browse the repository at this point in the history
fix `FieldResult.answer_display` method so it works with multiple answers
  • Loading branch information
paltman committed Aug 3, 2015
2 parents a8699bd + e68db46 commit 5066adb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions formly/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,8 @@ def answer_value(self):
def answer_display(self):
val = self.answer_value()
if val and self.question.needs_choices:
if self.question.field_type == Field.CHECKBOX_FIELD:
return u", ".join([unicode(FieldChoice.objects.get(pk=int(v))) for v in val])
return FieldChoice.objects.get(pk=int(val))
return val

Expand Down

0 comments on commit 5066adb

Please sign in to comment.