123456789101112131415161718192021222324 |
- from django import forms
- from django.contrib.auth.models import User
- from django.contrib.auth.forms import UserCreationForm
- from .models import UserProfile
-
-
- class UserRegistrationForm(UserCreationForm):
- email = forms.EmailField()
-
- class Meta:
- model = User
- fields = ['username', 'email', 'password1', 'password2']
-
-
- class UserProfileForm(forms.ModelForm):
- class Meta:
- model = UserProfile
- fields = ['timezone', 'language_code']
-
-
- class UserProfileFormLanguageOnly(forms.ModelForm):
- class Meta:
- model = UserProfile
- fields = ['language_code']
|