Mercurial > public > sg101
comparison contact/forms.py @ 1070:6ac56115e0a8
Convert contact form & views to V3.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 09 Apr 2016 17:15:32 -0500 |
parents | 79a71b9d0a2a |
children | b957e4829a03 |
comparison
equal
deleted
inserted
replaced
1069:ae015fcec351 | 1070:6ac56115e0a8 |
---|---|
7 from core.functions import send_mail | 7 from core.functions import send_mail |
8 | 8 |
9 | 9 |
10 class ContactForm(forms.Form): | 10 class ContactForm(forms.Form): |
11 """Form used to contact the website admins""" | 11 """Form used to contact the website admins""" |
12 name=forms.CharField(label="Your Name", max_length=61, | 12 name=forms.CharField(label="Your Name") |
13 widget=forms.TextInput(attrs={'size': 50 })) | 13 email=forms.EmailField(label="Your Email") |
14 email=forms.EmailField(label="Your Email", | 14 subject=forms.CharField() |
15 widget=forms.TextInput(attrs={'size': 50 })) | |
16 subject=forms.CharField(max_length=64, | |
17 widget=forms.TextInput(attrs={'size': 50 })) | |
18 honeypot=forms.CharField(max_length=64, required=False, | 15 honeypot=forms.CharField(max_length=64, required=False, |
19 label='If you enter anything in this field your message will be treated as spam') | 16 label='If you enter anything in this field your message will be treated as spam') |
20 message=forms.CharField(label="Your Message", | 17 message=forms.CharField(label="Your Message", |
21 widget=forms.Textarea(attrs={'rows': 16, 'cols': 50}), | 18 widget=forms.Textarea(), |
22 max_length=3000) | 19 max_length=3000) |
23 | 20 |
24 recipient_list = [mail_tuple[1] for mail_tuple in settings.MANAGERS] | 21 recipient_list = [mail_tuple[1] for mail_tuple in settings.MANAGERS] |
25 | 22 |
26 def clean_honeypot(self): | 23 def clean_honeypot(self): |