From 2e4a5f239283af883532e367bdb9d81c2c311f1c Mon Sep 17 00:00:00 2001 From: ashwinishinde Date: Wed, 18 Mar 2015 14:46:34 +0530 Subject: Subject:FOSSEE forum registration and category Description: 1) Registartion 2) added fossee category 3) removed Issues 4) removed Tutorials 5) resolve MyQuestion and MyAnswer Uid problem --- website/forms.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'website/forms.py') diff --git a/website/forms.py b/website/forms.py index 14f4d2d..d6f281c 100644 --- a/website/forms.py +++ b/website/forms.py @@ -4,11 +4,22 @@ from website.models import * #from spoken_auth.models import TutorialDetails from django.db.models import Q class NewQuestionForm(forms.ModelForm): - category = forms.ModelChoiceField(widget = forms.Select(attrs = {}), queryset = FossCategory.objects.order_by('name'), empty_label = "Select a category", error_messages = {'required':'Categoty field required.'}) - tutorial = forms.ModelChoiceField(widget = forms.Select(attrs = {}), queryset = Issue.objects.order_by('name'), empty_label = "Select a Issue", error_messages = {'required':'Issue field required.'}) + category = forms.ModelChoiceField(widget = forms.Select(attrs = {}), + queryset = FossCategory.objects.order_by('name'), + empty_label = "Select a category", + error_messages = {'required':'Categoty field required.'}) + + '''tutorial = forms.ModelChoiceField(widget = forms.Select(attrs = {}), q + ueryset = Issue.objects.order_by('name'), + empty_label = "Select a Issue", + error_messages = {'required':'Issue field required.'})''' + '''class Meta: + model = Question + fields = ['category', 'tutorial', 'title', 'body']''' + class Meta: model = Question - fields = ['category', 'tutorial', 'title', 'body'] + fields = ['category', 'title', 'body'] def __init__(self, *args, **kwargs): category = kwargs.pop('category', None) -- cgit