File: html5.py

package info (click to toggle)
wtforms-components 0.11.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 352 kB
  • sloc: python: 1,582; makefile: 135; sh: 11
file content (66 lines) | stat: -rw-r--r-- 1,241 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
from wtforms.fields import (
    DateField,
    DateTimeField,
    DecimalField,
    DecimalRangeField,
    IntegerField,
    IntegerRangeField,
    SearchField,
)
from wtforms.fields import StringField as _StringField

from ..widgets import (
    DateInput,
    DateTimeInput,
    DateTimeLocalInput,
    EmailInput,
    NumberInput,
    RangeInput,
    SearchInput,
    TextInput,
)


class EmailField(_StringField):
    widget = EmailInput()


class IntegerField(IntegerField):
    widget = NumberInput(step="1")


class DecimalField(DecimalField):
    widget = NumberInput(step="any")


class DateTimeLocalField(DateTimeField):
    def __init__(
        self, label=None, validators=None, format="%Y-%m-%dT%H:%M:%S", **kwargs
    ):
        super().__init__(label, validators, format, **kwargs)

    widget = DateTimeLocalInput()


class DateTimeField(DateTimeField):
    widget = DateTimeInput()


class DateField(DateField):
    widget = DateInput()


class IntegerSliderField(IntegerRangeField):
    widget = RangeInput(step="1")


class DecimalSliderField(DecimalRangeField):
    widget = RangeInput(step="any")


class SearchField(SearchField):
    widget = SearchInput()


class StringField(_StringField):
    widget = TextInput()