Use datepicker inputs for birth date

This commit is contained in:
Yohann D'ANELLO 2020-09-19 21:07:04 +02:00
parent dac4460c68
commit f2b498c352
1 changed files with 10 additions and 0 deletions

View File

@ -1,3 +1,4 @@
from bootstrap_datepicker_plus import DatePickerInput
from django.contrib.auth.forms import UserCreationForm
from django import forms
from django.utils.translation import gettext_lazy as _
@ -41,6 +42,9 @@ class SignUpForm(UserCreationForm):
'responsible_email',
'description',
)
widgets = {
"birth_date": DatePickerInput(),
}
class TFJMUserForm(forms.ModelForm):
@ -52,6 +56,9 @@ class TFJMUserForm(forms.ModelForm):
fields = ('last_name', 'first_name', 'email', 'phone_number', 'gender', 'birth_date', 'address', 'postal_code',
'city', 'country', 'school', 'student_class', 'responsible_name', 'responsible_phone',
'responsible_email',)
widgets = {
"birth_date": DatePickerInput(),
}
class CoachUserForm(forms.ModelForm):
@ -62,6 +69,9 @@ class CoachUserForm(forms.ModelForm):
model = TFJMUser
fields = ('last_name', 'first_name', 'email', 'phone_number', 'gender', 'birth_date', 'address', 'postal_code',
'city', 'country', 'description',)
widgets = {
"birth_date": DatePickerInput(),
}
class AdminUserForm(forms.ModelForm):