jobportal/users/forms.py
2021-01-11 20:40:44 +01:00

23 lines
636 B
Python

from django import forms
from django.contrib.auth.forms import UserCreationForm
from users.models import Account, Profile
class AccountRegisterForm(UserCreationForm):
CHOICES = [('is_employee', 'Employee'), ('is_employer', 'Employer')]
user_types = forms.CharField(label="User Type", widget=forms.RadioSelect(choices=CHOICES))
class Meta:
model = Account
fields = ['email', 'first_name', 'last_name']
class UserUpdateForm(forms.ModelForm):
class Meta:
model = Profile
exclude = ('user',)
widgets = {
'birthday': forms.DateInput(attrs={'type': 'date'})
}