34 lines
865 B
Python
34 lines
865 B
Python
from django import forms
|
|
from django.utils.translation import ugettext_lazy as _
|
|
|
|
from accounts.models import Profile
|
|
from django.contrib.auth.models import User
|
|
|
|
class ProfileForm(forms.ModelForm):
|
|
class Meta:
|
|
model = Profile
|
|
exclude = [
|
|
'suggested',
|
|
'translated',
|
|
]
|
|
|
|
class UserForm(forms.ModelForm):
|
|
class Meta:
|
|
model = User
|
|
fields = [
|
|
'first_name',
|
|
'last_name',
|
|
'email',
|
|
]
|
|
|
|
class ContactForm(forms.Form):
|
|
subject = forms.CharField(label = _('Subject'), required = True)
|
|
name = forms.CharField(label = _('Your name'), required = True)
|
|
email = forms.EmailField(label = _('Your email'), required = True)
|
|
message = forms.CharField(
|
|
label = _('Message'),
|
|
required = True,
|
|
widget = forms.Textarea
|
|
)
|
|
|