Source code for wtforms.fields.html5

"""
Fields to support various HTML5 input types.
"""
from ..widgets import html5 as widgets
from . import core

__all__ = (
    'DateField', 'DateTimeField', 'DateTimeLocalField', 'DecimalField',
    'DecimalRangeField', 'EmailField', 'IntegerField', 'IntegerRangeField',
    'SearchField', 'TelField', 'TimeField', 'URLField',
)


[docs]class SearchField(core.StringField): """ Represents an ``<input type="search">``. """ widget = widgets.SearchInput()
[docs]class TelField(core.StringField): """ Represents an ``<input type="tel">``. """ widget = widgets.TelInput()
[docs]class URLField(core.StringField): """ Represents an ``<input type="url">``. """ widget = widgets.URLInput()
[docs]class EmailField(core.StringField): """ Represents an ``<input type="email">``. """ widget = widgets.EmailInput()
[docs]class DateTimeField(core.DateTimeField): """ Represents an ``<input type="datetime">``. """ widget = widgets.DateTimeInput()
[docs]class DateField(core.DateField): """ Represents an ``<input type="date">``. """ widget = widgets.DateInput()
[docs]class TimeField(core.TimeField): """ Represents an ``<input type="time">``. """ widget = widgets.TimeInput()
[docs]class DateTimeLocalField(core.DateTimeField): """ Represents an ``<input type="datetime-local">``. """ widget = widgets.DateTimeLocalInput()
[docs]class IntegerField(core.IntegerField): """ Represents an ``<input type="number">``. """ widget = widgets.NumberInput()
[docs]class DecimalField(core.DecimalField): """ Represents an ``<input type="number">``. """ widget = widgets.NumberInput(step='any')
[docs]class IntegerRangeField(core.IntegerField): """ Represents an ``<input type="range">``. """ widget = widgets.RangeInput()
[docs]class DecimalRangeField(core.DecimalField): """ Represents an ``<input type="range">``. """ widget = widgets.RangeInput(step='any')