diff options
author | Weitian LI <liweitianux@gmail.com> | 2014-04-20 23:58:30 +0800 |
---|---|---|
committer | Weitian LI <liweitianux@gmail.com> | 2014-04-20 23:58:30 +0800 |
commit | c11363e94069139f89c613c678624458fe167e66 (patch) | |
tree | cfb3dc85e7d4ab610bbcb1e5148bf388e6232fb9 /account/forms.py | |
parent | f74743aca5ffa55c717b336a314b58d59f4abc03 (diff) | |
download | django-skaschool-c11363e94069139f89c613c678624458fe167e66.tar.bz2 |
* added 'profile', 'profile_update' and 'profile_update_done' templates
and implemented related views
* added 'account.forms.UpdateProfileForm'
* implemented 'account.views.UpdateProfileView' using class-based view
* updated 'account.urls'
Diffstat (limited to 'account/forms.py')
-rw-r--r-- | account/forms.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/account/forms.py b/account/forms.py index 6a566e9..ca54711 100644 --- a/account/forms.py +++ b/account/forms.py @@ -8,6 +8,8 @@ from django import forms from registration.forms import RegistrationFormUniqueEmail from django.utils.translation import ugettext_lazy as _ +from account.models import UserProfile + class UserRegForm(RegistrationFormUniqueEmail): """ @@ -38,3 +40,15 @@ class UserRegForm(RegistrationFormUniqueEmail): ] +class UpdateProfileForm(forms.ModelForm): + """ + ModelForm of 'UserProfile' used in 'UpdateProfileView' + """ + # extra email field + email = forms.EmailField(label=_("E-mail")) + + class Meta: + model = UserProfile + fields = ('realname', 'gender', 'institute') + + |