from django import newforms as forms from django contrib auth models i

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
from django import newforms as forms
from django.contrib.auth.models import User
class EditProfileForm(forms.ModelForm):
class Meta:
model = User
fields = ['first_name', 'last_name', 'country', 'city', 'blog', 'need_work', 'icq', 'jabber', 'msn', 'ym', 'public_email']
def clean_county(self):
if 'country' in self.cleaned_data:
return self.cleaned_data['country'].title()
def clean_city(self):
if 'city' in self.cleaned_data:
return self.cleaned_data['city'].title()