Tuesday, June 26, 2018

Using Django admin datepicker in a custom form

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()}



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAPCf-y5PgXaHrL-HMPwUc8SXUeq6EgcyLaipN3PLc%3D1Z7gseJA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment