From c11363e94069139f89c613c678624458fe167e66 Mon Sep 17 00:00:00 2001 From: Weitian LI Date: Sun, 20 Apr 2014 23:58:30 +0800 Subject: * 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' --- account/forms.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'account/forms.py') 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') + + -- cgit v1.2.2