jobportal/users/forms.py

34 lines
876 B
Python
Raw Normal View History

2021-01-15 12:27:14 +01:00
import form as form
2020-12-31 15:10:53 +01:00
from django import forms
from django.contrib.auth.forms import UserCreationForm
2021-01-15 12:27:14 +01:00
from users.models import Account, Profile, Invite
2020-12-31 15:10:53 +01:00
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']
2021-01-11 20:40:44 +01:00
class UserUpdateForm(forms.ModelForm):
class Meta:
model = Profile
exclude = ('user',)
widgets = {
'birthday': forms.DateInput(attrs={'type': 'date'})
}
2021-01-15 12:27:14 +01:00
class InviteEmployeeForm(forms.ModelForm):
class Meta:
model = Invite
fields = ('date', 'message')
widgets = {
'date': forms.DateInput(attrs={'type': 'date'})
}