From 1035cb5d0230566501ea2b974611f9c5867325e9 Mon Sep 17 00:00:00 2001 From: prathamesh Date: Sat, 6 Dec 2014 16:49:20 +0530 Subject: Feedback form added --- certificate/forms.py | 18 +++++++++++++++ certificate/models.py | 24 ++++++++++++++++++++ certificate/templates/download.html | 4 ++-- certificate/templates/feedback.html | 26 +++++++++++++++++++++ certificate/templates/verify.html | 2 +- certificate/urls.py | 3 ++- certificate/views.py | 45 ++++++++++++++++++++++++++++++++++++- 7 files changed, 117 insertions(+), 5 deletions(-) create mode 100644 certificate/forms.py create mode 100644 certificate/templates/feedback.html diff --git a/certificate/forms.py b/certificate/forms.py new file mode 100644 index 0000000..321ffba --- /dev/null +++ b/certificate/forms.py @@ -0,0 +1,18 @@ +from django import forms +from certificate.models import FeedBack + +class FeedBackForm(forms.Form): + name = forms.CharField(max_length=30) + email = forms.EmailField() + phone = forms.CharField(max_length=15) + organisation = forms.CharField(max_length=30) + department = forms.CharField\ + (max_length=64) + role = forms.CharField\ + (max_length=64) + address = forms.CharField(max_length=256, widget=forms.Textarea(attrs={'rows':1})) + city = forms.CharField(max_length=30) + pincode_number = forms.CharField\ + (max_length=30) + state = forms.CharField\ + (max_length=128) diff --git a/certificate/models.py b/certificate/models.py index bc531b0..0737caf 100644 --- a/certificate/models.py +++ b/certificate/models.py @@ -65,3 +65,27 @@ class Scilab_workshop(models.Model): workshops = models.CharField(max_length=300) purpose = models.CharField(max_length=10, default='SLC') attendance = models.BooleanField(default=False) + +class FeedBack(models.Model): + ''' Feed back form for the event ''' + name = models.CharField(max_length=100) + email = models.CharField(max_length=100) + phone = models.CharField(max_length=20) + institution = models.CharField(max_length=100) + role = models.CharField(max_length=100) + address = models.CharField(max_length=100) + city = models.CharField(max_length=50) + pin_number = models.CharField(max_length=10) + state = models.CharField(max_length=50) + purpose = models.CharField(max_length=10, default='SLC') + submitted = models.BooleanField(default=False) + answer = models.ManyToManyField('Answer') + + +class Question(models.Model): + question = models.CharField(max_length=500) + purpose = models.CharField(max_length=10, default='SLC') + +class Answer(models.Model): + question = models.ForeignKey(Question) + answer = models.CharField(max_length=1000) diff --git a/certificate/templates/download.html b/certificate/templates/download.html index e23695e..32dab33 100644 --- a/certificate/templates/download.html +++ b/certificate/templates/download.html @@ -14,9 +14,9 @@ -