diff options
author | ashwinishinde | 2015-03-18 14:46:34 +0530 |
---|---|---|
committer | ashwinishinde | 2015-03-18 14:46:34 +0530 |
commit | 2e4a5f239283af883532e367bdb9d81c2c311f1c (patch) | |
tree | 8baf9fb9c634622cdf1b85d70ac4764f09946ad0 /website/forms.py | |
parent | 130bb98ed8876aa48c94d98650729f6662024db1 (diff) | |
download | FOSSEE-Forum-2e4a5f239283af883532e367bdb9d81c2c311f1c.tar.gz FOSSEE-Forum-2e4a5f239283af883532e367bdb9d81c2c311f1c.tar.bz2 FOSSEE-Forum-2e4a5f239283af883532e367bdb9d81c2c311f1c.zip |
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
Diffstat (limited to 'website/forms.py')
-rw-r--r-- | website/forms.py | 17 |
1 files changed, 14 insertions, 3 deletions
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) |