diff options
author | Prabhu Ramachandran | 2016-05-04 11:13:10 +0530 |
---|---|---|
committer | Prabhu Ramachandran | 2016-05-04 11:13:10 +0530 |
commit | 03f0aa839e4d91a3d83d68d5301f1425f18cca73 (patch) | |
tree | 26ba7a6d92878844a25d988cb57112f287b7a85c /yaksh/forms.py | |
parent | 825f8464ef1b2853c029cc23bf7fb89f6a9c1c09 (diff) | |
parent | 78795446d89ae5c247f5424d70d652437c93cda6 (diff) | |
download | online_test-03f0aa839e4d91a3d83d68d5301f1425f18cca73.tar.gz online_test-03f0aa839e4d91a3d83d68d5301f1425f18cca73.tar.bz2 online_test-03f0aa839e4d91a3d83d68d5301f1425f18cca73.zip |
Merge pull request #92 from adityacp/Add_Teachers
Add teachers to a course
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 |