from django.forms.extras.widgets import SelectDateWidget
datefiled = forms.DateField( widget=SelectDateWidget(years=range(2012,1970,-1)))
datefiled = forms.DateField( widget=SelectDateWidget(years=range(2012,1970,-1)))
即可將日期欄位設定為年月日三個下拉式選單。
配合年月日順序,修改settings.py
DATE_FORMAT = "Y N j"
0 留言