xmpp.chapril.org-conversejs/accounts/forms.py

34 lines
865 B
Python
Raw Normal View History

2012-03-02 16:16:20 +01:00
from django import forms
2012-03-05 10:55:21 +01:00
from django.utils.translation import ugettext_lazy as _
2012-03-02 16:16:20 +01:00
from accounts.models import Profile
2012-03-02 16:38:41 +01:00
from django.contrib.auth.models import User
2012-03-02 16:16:20 +01:00
class ProfileForm(forms.ModelForm):
class Meta:
model = Profile
exclude = [
'suggested',
'translated',
]
2012-03-02 16:38:41 +01:00
class UserForm(forms.ModelForm):
class Meta:
model = User
fields = [
'first_name',
'last_name',
'email',
]
2012-03-05 10:55:21 +01:00
2012-03-05 11:44:26 +01:00
class ContactForm(forms.Form):
subject = forms.CharField(label = _('Subject'), required = True)
2012-03-05 11:46:50 +01:00
name = forms.CharField(label = _('Your name'), required = True)
email = forms.EmailField(label = _('Your email'), required = True)
2012-03-05 11:44:26 +01:00
message = forms.CharField(
2012-03-05 10:55:21 +01:00
label = _('Message'),
required = True,
widget = forms.Textarea
)