From 4f23c724beaf03f5340a24a0c4776d6a407805ef Mon Sep 17 00:00:00 2001 From: Sanj Date: Thu, 13 Oct 2011 15:44:25 +0530 Subject: [PATCH] contact form --- itf/frontpage/views.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/itf/frontpage/views.py b/itf/frontpage/views.py index 6f88ce9..728670b 100755 --- a/itf/frontpage/views.py +++ b/itf/frontpage/views.py @@ -4,6 +4,20 @@ from models import * from settings import TWITTER_ID import twitter from django.template import RequestContext +from django import forms +from django.forms.widgets import Textarea + +class ContactForm(forms.Form): + email = forms.EmailField() + name = forms.CharField(max_length=255) + message = forms.CharField(widget=Textarea(attrs={'cols': 80, 'rows': 20})) + + ''' + class Meta: + widgets = { + 'message': Textarea(attrs={'cols': 80, 'rows': 20}) + } + ''' def index(request): try: @@ -18,5 +32,8 @@ def index(request): })) def contact(request): - return render_to_response("registration/contact.html", RequestContext(request, {})) +# form = ContactForm() + return render_to_response("registration/contact.html", RequestContext(request, { + 'form': ContactForm() + }))