From d27b168e6fa0789891acf8952a60a7c200caef44 Mon Sep 17 00:00:00 2001 From: adityacp Date: Mon, 20 Jun 2016 14:50:58 +0530 Subject: added files upload for questions --- yaksh/forms.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'yaksh/forms.py') diff --git a/yaksh/forms.py b/yaksh/forms.py index a443e34..1226fe2 100644 --- a/yaksh/forms.py +++ b/yaksh/forms.py @@ -175,6 +175,11 @@ class QuestionForm(forms.ModelForm): exclude = ['user'] +class FileForm(forms.Form): + file_field = forms.FileField(widget=forms.ClearableFileInput(attrs={'multiple': True}), + required=False) + + class RandomQuestionForm(forms.Form): question_type = forms.CharField(max_length=8, widget=forms.Select\ (choices=question_types)) @@ -211,7 +216,7 @@ class ProfileForm(forms.ModelForm): class Meta: model = Profile fields = ['first_name', 'last_name', 'institute', - 'department', 'roll_number', 'position', 'timezone'] + 'department', 'roll_number', 'position', 'timezone'] first_name = forms.CharField(max_length=30) last_name = forms.CharField(max_length=30) -- cgit