diff options
author | adityacp | 2016-04-26 19:00:01 +0530 |
---|---|---|
committer | adityacp | 2016-04-26 19:00:01 +0530 |
commit | 5d92e6fac7901c9829a759aec539e603dfb66038 (patch) | |
tree | 28b4f46c254fd2611660be1c75ef46e246b528d9 /yaksh/forms.py | |
parent | 825f8464ef1b2853c029cc23bf7fb89f6a9c1c09 (diff) | |
download | online_test-5d92e6fac7901c9829a759aec539e603dfb66038.tar.gz online_test-5d92e6fac7901c9829a759aec539e603dfb66038.tar.bz2 online_test-5d92e6fac7901c9829a759aec539e603dfb66038.zip |
rebase changes
Diffstat (limited to 'yaksh/forms.py')
-rw-r--r-- | yaksh/forms.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/yaksh/forms.py b/yaksh/forms.py index 681eca0..16f82fb 100644 --- a/yaksh/forms.py +++ b/yaksh/forms.py @@ -6,7 +6,7 @@ from django.contrib.auth.models import User from taggit.managers import TaggableManager from taggit.forms import TagField from django.forms.models import inlineformset_factory - +from django.db.models import Q from string import letters, punctuation, digits import datetime @@ -138,7 +138,8 @@ class QuizForm(forms.ModelForm): queryset=Quiz.objects.filter(course__creator=user)) self.fields['prerequisite'].required = False self.fields['course'] = forms.ModelChoiceField( - queryset=Course.objects.filter(creator=user)) + queryset=Course.objects.filter(Q(creator=user)| + Q(teachers=user)).distinct()) class Meta: model = Quiz |