Add a file upload type to questions (#534)

* Initial stuff

* More features
This commit is contained in:
Raphael Michel
2017-07-03 14:22:31 +02:00
committed by GitHub
parent 678d510e29
commit 0db5d062be
18 changed files with 334 additions and 20 deletions

View File

@@ -446,6 +446,7 @@ class Question(LoggedModel):
* a multi-line string (``TYPE_TEXT``)
* a boolean (``TYPE_BOOLEAN``)
* a multiple choice option (``TYPE_CHOICE`` and ``TYPE_CHOICE_MULTIPLE``)
* a file upload (``TYPE_FILE``))
:param event: The event this question belongs to
:type event: Event
@@ -463,13 +464,15 @@ class Question(LoggedModel):
TYPE_BOOLEAN = "B"
TYPE_CHOICE = "C"
TYPE_CHOICE_MULTIPLE = "M"
TYPE_FILE = "F"
TYPE_CHOICES = (
(TYPE_NUMBER, _("Number")),
(TYPE_STRING, _("Text (one line)")),
(TYPE_TEXT, _("Multiline text")),
(TYPE_BOOLEAN, _("Yes/No")),
(TYPE_CHOICE, _("Choose one from a list")),
(TYPE_CHOICE_MULTIPLE, _("Choose multiple from a list"))
(TYPE_CHOICE_MULTIPLE, _("Choose multiple from a list")),
(TYPE_FILE, _("File upload")),
)
event = models.ForeignKey(