summaryrefslogtreecommitdiff
path: root/yaksh/forms.py
diff options
context:
space:
mode:
authorPrabhu Ramachandran2016-04-13 16:58:00 +0530
committerPrabhu Ramachandran2016-04-13 16:58:00 +0530
commit97bdb23fbacc3e625beb96efdf58431f42604a81 (patch)
tree06d3cd76a3f38b4ceb8ba7e93d64db12ba9f5b7f /yaksh/forms.py
parent2dfef7f76cb04b34901650dc9ae0f41ef394d6ba (diff)
parent523390f284b93e10af35058931b06eed1550700c (diff)
downloadonline_test-97bdb23fbacc3e625beb96efdf58431f42604a81.tar.gz
online_test-97bdb23fbacc3e625beb96efdf58431f42604a81.tar.bz2
online_test-97bdb23fbacc3e625beb96efdf58431f42604a81.zip
Merge pull request #91 from prathamesh920/migration_to_django_1_9
Migration from django 1.6 to django 1.9
Diffstat (limited to 'yaksh/forms.py')
-rw-r--r--yaksh/forms.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/yaksh/forms.py b/yaksh/forms.py
index 6ad388f..84cf1c4 100644
--- a/yaksh/forms.py
+++ b/yaksh/forms.py
@@ -136,12 +136,14 @@ class QuizForm(forms.ModelForm):
super(QuizForm, self).__init__(*args, **kwargs)
self.fields['prerequisite'] = forms.ModelChoiceField(
queryset=Quiz.objects.filter(course__creator=user))
+ self.fields['prerequisite'].required = False
self.fields['course'] = forms.ModelChoiceField(
queryset=Course.objects.filter(creator=user))
class Meta:
model = Quiz
+ fields = '__all__'
class QuestionForm(forms.ModelForm):
@@ -150,6 +152,7 @@ class QuestionForm(forms.ModelForm):
class Meta:
model = Question
+ fields = '__all__'
class RandomQuestionForm(forms.Form):
@@ -176,7 +179,7 @@ class QuestionFilterForm(forms.Form):
(choices=question_types))
-TestCaseFormSet = inlineformset_factory(Question, TestCase,\
+TestCaseFormSet = inlineformset_factory(Question, TestCase, fields='__all__',
can_order=False, can_delete=False, extra=1)