-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforms.py
More file actions
22 lines (18 loc) · 763 Bytes
/
forms.py
File metadata and controls
22 lines (18 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# -*- coding: utf-8 -*-
# Copyright (c) 2011, BE-DAL Inc. See
# the COPYRIGHT file.
# django
from django import forms
from django.utils.translation import ugettext_lazy as _
# be_dal
from be_dal.captcha.fields import CaptchaField
class ContactForm(forms.Form):
email = forms.EmailField(label=_(u'Your email'),
error_messages = {'invalid': _("This should be an email address"),
'required': _("Your email is required")})
name = forms.CharField(label=_(u'Your name'),
error_messages = {'required': _("Your name is required")})
subject = forms.CharField(label=_(u'Subject'),
error_messages = {'required': _("A subject is required")})
message = forms.CharField(widget=forms.Textarea)
captcha = CaptchaField(label=_(u'Security test'))