From 523390f284b93e10af35058931b06eed1550700c Mon Sep 17 00:00:00 2001 From: prathamesh Date: Mon, 11 Apr 2016 18:20:29 +0530 Subject: Migration from django 1.6 to django 1.9 - upgraded django-taggit to 0.18 from 0.12.2 - added fields attribute in django forms, mandatory in django 1.9 - get_profile attribute of User object deprecated, used hasattr instead. - Template settings changed in django 1.9, all template related settings at one place. - Support for string view arguments to url() is deprecated, so passed callable views instead. - django.conf.urls.patterns() is deprecated, updated urlpatterns to a list of django.conf.urls.url() instances instead. - django.utils.unittest is deprecated, used unittest instead. - made changes in requirements and setup files other - added quiz prerequisite required as false in forms, so that the quiz is added without any prerequisite. - Time zone settings not implemented. --- yaksh/forms.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'yaksh/forms.py') 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) -- cgit