diff --git a/tailbone/forms/core.py b/tailbone/forms/core.py index 2ecdbb5c..ceda975f 100644 --- a/tailbone/forms/core.py +++ b/tailbone/forms/core.py @@ -48,7 +48,7 @@ from webhelpers2.html import tags, HTML from tailbone.util import raw_datetime from . import types -from .widgets import ReadonlyWidget, JQueryDateWidget, JQueryTimeWidget +from .widgets import ReadonlyWidget, PlainDateWidget, JQueryDateWidget, JQueryTimeWidget log = logging.getLogger(__name__) @@ -570,6 +570,8 @@ class Form(object): self.set_renderer(key, self.render_datetime) elif type_ == 'datetime_local': self.set_renderer(key, self.render_datetime_local) + elif type_ == 'date_plain': + self.set_widget(key, PlainDateWidget()) elif type_ == 'date_jquery': # TODO: is this safe / a good idea? # self.set_node(key, colander.Date()) diff --git a/tailbone/forms/widgets.py b/tailbone/forms/widgets.py index b90f9dda..ddb71b78 100644 --- a/tailbone/forms/widgets.py +++ b/tailbone/forms/widgets.py @@ -96,6 +96,10 @@ class JQuerySelectWidget(dfwidget.SelectWidget): template = 'select_jquery' +class PlainDateWidget(dfwidget.DateInputWidget): + template = 'date_plain' + + class JQueryDateWidget(dfwidget.DateInputWidget): """ Uses the jQuery datepicker UI widget, instead of whatever it is deform uses diff --git a/tailbone/templates/deform/date_plain.pt b/tailbone/templates/deform/date_plain.pt new file mode 100644 index 00000000..b473e422 --- /dev/null +++ b/tailbone/templates/deform/date_plain.pt @@ -0,0 +1,16 @@ +
+ ${field.start_mapping()} + + ${field.end_mapping()} +