Лежит в django.newforms.extras.widgets.SelectDateWidget
Пример использования:
import datetime from django import newforms as forms from django.newforms.extras.widgets import SelectDateWidget from django.utils.translation import ugettext as _ year = datetime.date.today().year class SampleForm(forms.Form): default_date = forms.DateField(label=_('Default date'), initial=datetime.date.today, help_text=_('Today date in text input.')) birth_date = forms.DateField(label=_('Birth date'), initial=datetime.date.today, help_text=_('Today date in 3 selects (each for day, month and year) with 100 latest years'), widget=SelectDateWidget(years=range(year, year-100, -1))) future_date = forms.DateField(label=_('Future date'), initial=datetime.date.today, help_text=_('Today date in 3 selects (each for day, month and year).'))
без применения всяких стилей эта форма будет выглядеть следующим образом:
0 комментариев:
Отправить комментарий