aboutsummaryrefslogtreecommitdiffstats
path: root/account/forms.py
diff options
context:
space:
mode:
authorWeitian LI <liweitianux@gmail.com>2014-04-20 23:58:30 +0800
committerWeitian LI <liweitianux@gmail.com>2014-04-20 23:58:30 +0800
commitc11363e94069139f89c613c678624458fe167e66 (patch)
treecfb3dc85e7d4ab610bbcb1e5148bf388e6232fb9 /account/forms.py
parentf74743aca5ffa55c717b336a314b58d59f4abc03 (diff)
downloaddjango-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.py14
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')
+
+