From f2b498c352cffce85722b37e2e6125bf5dab44ca Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sat, 19 Sep 2020 21:07:04 +0200 Subject: [PATCH] Use datepicker inputs for birth date --- apps/member/forms.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apps/member/forms.py b/apps/member/forms.py index 083b7b4..6fb9f6c 100644 --- a/apps/member/forms.py +++ b/apps/member/forms.py @@ -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):