python - Django 1.11 - forms.Models: change default form widget for DateTimeField -


i have data field

missing_date = models.datetimefield(null=true, blank=false) 

the default django form widget use textinput, , not displaying calendar date/time select in admin page.

can please advise how can display calendar date/time below: calendar date/time widget

it appreciated help.

thanks henry

are able include more of code. i.e. have created forms.py file? presume creating modelforms?

if have can this:

from django.forms import widget class dateinput(forms.dateinput):     input_type = 'date'  class example(models.modelform):     class meta: #insert class meta below          model = #reference model          fields = () #include fields want display model          widgets = {                'missing_date': date_input()          } 

Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -