Using Django admin datepicker in a custom form

35 views
Skip to first unread message

sum abiut

unread,
Jun 27, 2018, 12:26:13 AM6/27/18
to django...@googlegroups.com

I am trying to use a django admin datepicker in a custom form. it is displaying alright but the year only begin in 2018 but no later than 2018. Please assist, below is my form.py

#my form.py

from django.forms.extras.widgets import SelectDateWidget
class ContactForm(forms.ModelForm):
    class Meta:
        model =contacts
        fields = ('First_Name','Middle_Name','Last_Name','Date_of_Birth','Gender','Island','Province','Date_of_Baptism','Congregation','Status','Comments',)

        widgets = {'Date_of_Birth': SelectDateWidget(),'Date_of_Baptism':SelectDateWidget()}



Reply all
Reply to author
Forward
0 new messages