mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-30 22:55:24 +08:00
@@ -1,3 +1,3 @@
|
||||
version = "3.1.*"
|
||||
upstream_repository = "https://github.com/wtforms/wtforms"
|
||||
version = "3.2.*"
|
||||
upstream_repository = "https://github.com/pallets-eco/wtforms"
|
||||
requires = ["MarkupSafe"]
|
||||
|
||||
@@ -1,4 +1,83 @@
|
||||
from typing import Final
|
||||
|
||||
from wtforms import validators as validators, widgets as widgets
|
||||
from wtforms.fields import *
|
||||
from wtforms.fields.choices import (
|
||||
RadioField as RadioField,
|
||||
SelectField as SelectField,
|
||||
SelectMultipleField as SelectMultipleField,
|
||||
)
|
||||
from wtforms.fields.core import Field as Field, Flags as Flags, Label as Label
|
||||
from wtforms.fields.datetime import (
|
||||
DateField as DateField,
|
||||
DateTimeField as DateTimeField,
|
||||
DateTimeLocalField as DateTimeLocalField,
|
||||
MonthField as MonthField,
|
||||
TimeField as TimeField,
|
||||
WeekField as WeekField,
|
||||
)
|
||||
from wtforms.fields.form import FormField as FormField
|
||||
from wtforms.fields.list import FieldList as FieldList
|
||||
from wtforms.fields.numeric import (
|
||||
DecimalField as DecimalField,
|
||||
DecimalRangeField as DecimalRangeField,
|
||||
FloatField as FloatField,
|
||||
IntegerField as IntegerField,
|
||||
IntegerRangeField as IntegerRangeField,
|
||||
)
|
||||
from wtforms.fields.simple import (
|
||||
BooleanField as BooleanField,
|
||||
ColorField as ColorField,
|
||||
EmailField as EmailField,
|
||||
FileField as FileField,
|
||||
HiddenField as HiddenField,
|
||||
MultipleFileField as MultipleFileField,
|
||||
PasswordField as PasswordField,
|
||||
SearchField as SearchField,
|
||||
StringField as StringField,
|
||||
SubmitField as SubmitField,
|
||||
TelField as TelField,
|
||||
TextAreaField as TextAreaField,
|
||||
URLField as URLField,
|
||||
)
|
||||
from wtforms.form import Form as Form
|
||||
from wtforms.validators import ValidationError as ValidationError
|
||||
|
||||
__version__: Final[str]
|
||||
__all__ = [
|
||||
"validators",
|
||||
"widgets",
|
||||
"Form",
|
||||
"ValidationError",
|
||||
"SelectField",
|
||||
"SelectMultipleField",
|
||||
"RadioField",
|
||||
"Field",
|
||||
"Flags",
|
||||
"Label",
|
||||
"DateTimeField",
|
||||
"DateField",
|
||||
"TimeField",
|
||||
"MonthField",
|
||||
"DateTimeLocalField",
|
||||
"WeekField",
|
||||
"FormField",
|
||||
"FieldList",
|
||||
"IntegerField",
|
||||
"DecimalField",
|
||||
"FloatField",
|
||||
"IntegerRangeField",
|
||||
"DecimalRangeField",
|
||||
"BooleanField",
|
||||
"TextAreaField",
|
||||
"PasswordField",
|
||||
"FileField",
|
||||
"MultipleFileField",
|
||||
"HiddenField",
|
||||
"SearchField",
|
||||
"SubmitField",
|
||||
"StringField",
|
||||
"TelField",
|
||||
"URLField",
|
||||
"EmailField",
|
||||
"ColorField",
|
||||
]
|
||||
|
||||
@@ -8,6 +8,8 @@ from wtforms.fields.core import UnboundField, _Filter, _FormT, _Validator, _Widg
|
||||
from wtforms.form import BaseForm
|
||||
from wtforms.meta import DefaultMeta, _SupportsGettextAndNgettext
|
||||
|
||||
__all__ = ("CSRFTokenField", "CSRF")
|
||||
|
||||
class CSRFTokenField(HiddenField):
|
||||
current_token: str | None
|
||||
csrf_impl: CSRF
|
||||
|
||||
@@ -6,6 +6,8 @@ from wtforms.csrf.core import CSRF, CSRFTokenField
|
||||
from wtforms.form import BaseForm
|
||||
from wtforms.meta import DefaultMeta
|
||||
|
||||
__all__ = ("SessionCSRF",)
|
||||
|
||||
class SessionCSRF(CSRF):
|
||||
TIME_FORMAT: str
|
||||
form_meta: DefaultMeta
|
||||
|
||||
@@ -1,8 +1,75 @@
|
||||
from wtforms.fields.choices import *
|
||||
from wtforms.fields.choices import SelectFieldBase as SelectFieldBase
|
||||
from wtforms.fields.choices import (
|
||||
RadioField as RadioField,
|
||||
SelectField as SelectField,
|
||||
SelectMultipleField as SelectMultipleField,
|
||||
)
|
||||
from wtforms.fields.core import Field as Field, Flags as Flags, Label as Label
|
||||
from wtforms.fields.datetime import *
|
||||
from wtforms.fields.form import *
|
||||
from wtforms.fields.list import *
|
||||
from wtforms.fields.numeric import *
|
||||
from wtforms.fields.simple import *
|
||||
from wtforms.fields.datetime import (
|
||||
DateField as DateField,
|
||||
DateTimeField as DateTimeField,
|
||||
DateTimeLocalField as DateTimeLocalField,
|
||||
MonthField as MonthField,
|
||||
TimeField as TimeField,
|
||||
WeekField as WeekField,
|
||||
)
|
||||
from wtforms.fields.form import FormField as FormField
|
||||
from wtforms.fields.list import FieldList as FieldList
|
||||
from wtforms.fields.numeric import (
|
||||
DecimalField as DecimalField,
|
||||
DecimalRangeField as DecimalRangeField,
|
||||
FloatField as FloatField,
|
||||
IntegerField as IntegerField,
|
||||
IntegerRangeField as IntegerRangeField,
|
||||
)
|
||||
from wtforms.fields.simple import (
|
||||
BooleanField as BooleanField,
|
||||
ColorField as ColorField,
|
||||
EmailField as EmailField,
|
||||
FileField as FileField,
|
||||
HiddenField as HiddenField,
|
||||
MultipleFileField as MultipleFileField,
|
||||
PasswordField as PasswordField,
|
||||
SearchField as SearchField,
|
||||
StringField as StringField,
|
||||
SubmitField as SubmitField,
|
||||
TelField as TelField,
|
||||
TextAreaField as TextAreaField,
|
||||
URLField as URLField,
|
||||
)
|
||||
from wtforms.utils import unset_value as _unset_value
|
||||
|
||||
__all__ = [
|
||||
"Field",
|
||||
"Flags",
|
||||
"Label",
|
||||
"SelectField",
|
||||
"SelectMultipleField",
|
||||
"RadioField",
|
||||
"DateTimeField",
|
||||
"DateField",
|
||||
"TimeField",
|
||||
"MonthField",
|
||||
"DateTimeLocalField",
|
||||
"WeekField",
|
||||
"FormField",
|
||||
"IntegerField",
|
||||
"DecimalField",
|
||||
"FloatField",
|
||||
"IntegerRangeField",
|
||||
"DecimalRangeField",
|
||||
"BooleanField",
|
||||
"TextAreaField",
|
||||
"PasswordField",
|
||||
"FileField",
|
||||
"MultipleFileField",
|
||||
"HiddenField",
|
||||
"SearchField",
|
||||
"SubmitField",
|
||||
"StringField",
|
||||
"TelField",
|
||||
"URLField",
|
||||
"EmailField",
|
||||
"ColorField",
|
||||
"FieldList",
|
||||
"_unset_value",
|
||||
]
|
||||
|
||||
@@ -6,6 +6,8 @@ from wtforms.fields.core import Field, _Filter, _FormT, _Validator, _Widget
|
||||
from wtforms.form import BaseForm
|
||||
from wtforms.meta import DefaultMeta, _SupportsGettextAndNgettext
|
||||
|
||||
__all__ = ("SelectField", "SelectMultipleField", "RadioField")
|
||||
|
||||
# technically this allows a list, but we're more strict for type safety
|
||||
_Choice: TypeAlias = tuple[Any, str] | tuple[Any, str, dict[str, Any]]
|
||||
# it's too difficult to get type safety here due to to nested partially invariant collections
|
||||
|
||||
@@ -7,6 +7,8 @@ from wtforms.fields.core import Field, _Filter, _FormT, _Validator, _Widget
|
||||
from wtforms.form import BaseForm
|
||||
from wtforms.meta import DefaultMeta, _SupportsGettextAndNgettext
|
||||
|
||||
__all__ = ("DateTimeField", "DateField", "TimeField", "MonthField", "DateTimeLocalField", "WeekField")
|
||||
|
||||
class DateTimeField(Field):
|
||||
format: list[str]
|
||||
strptime_format: list[str]
|
||||
|
||||
@@ -5,6 +5,8 @@ from wtforms.fields.core import Field, _Widget
|
||||
from wtforms.form import BaseForm
|
||||
from wtforms.meta import DefaultMeta, _SupportsGettextAndNgettext
|
||||
|
||||
__all__ = ("FormField",)
|
||||
|
||||
_BoundFormT = TypeVar("_BoundFormT", bound=BaseForm)
|
||||
|
||||
class FormField(Field, Generic[_BoundFormT]):
|
||||
|
||||
@@ -5,6 +5,8 @@ from wtforms.fields.core import Field, UnboundField, _FormT, _Validator, _Widget
|
||||
from wtforms.form import BaseForm
|
||||
from wtforms.meta import DefaultMeta, _SupportsGettextAndNgettext
|
||||
|
||||
__all__ = ("FieldList",)
|
||||
|
||||
_BoundFieldT = TypeVar("_BoundFieldT", bound=Field)
|
||||
|
||||
class FieldList(Field, Generic[_BoundFieldT]):
|
||||
|
||||
@@ -6,6 +6,22 @@ from wtforms.fields.core import Field, _Filter, _FormT, _Validator, _Widget
|
||||
from wtforms.form import BaseForm
|
||||
from wtforms.meta import DefaultMeta, _SupportsGettextAndNgettext
|
||||
|
||||
__all__ = (
|
||||
"BooleanField",
|
||||
"TextAreaField",
|
||||
"PasswordField",
|
||||
"FileField",
|
||||
"MultipleFileField",
|
||||
"HiddenField",
|
||||
"SearchField",
|
||||
"SubmitField",
|
||||
"StringField",
|
||||
"TelField",
|
||||
"URLField",
|
||||
"EmailField",
|
||||
"ColorField",
|
||||
)
|
||||
|
||||
class BooleanField(Field):
|
||||
data: bool
|
||||
default: bool | Callable[[], bool] | None
|
||||
|
||||
@@ -6,6 +6,42 @@ from typing import Any, TypeVar, overload
|
||||
from wtforms.fields import Field, StringField
|
||||
from wtforms.form import BaseForm
|
||||
|
||||
__all__ = (
|
||||
"DataRequired",
|
||||
"data_required",
|
||||
"Email",
|
||||
"email",
|
||||
"EqualTo",
|
||||
"equal_to",
|
||||
"IPAddress",
|
||||
"ip_address",
|
||||
"InputRequired",
|
||||
"input_required",
|
||||
"Length",
|
||||
"length",
|
||||
"NumberRange",
|
||||
"number_range",
|
||||
"Optional",
|
||||
"optional",
|
||||
"Regexp",
|
||||
"regexp",
|
||||
"URL",
|
||||
"url",
|
||||
"AnyOf",
|
||||
"any_of",
|
||||
"NoneOf",
|
||||
"none_of",
|
||||
"MacAddress",
|
||||
"mac_address",
|
||||
"UUID",
|
||||
"ValidationError",
|
||||
"StopValidation",
|
||||
"readonly",
|
||||
"ReadOnly",
|
||||
"disabled",
|
||||
"Disabled",
|
||||
)
|
||||
|
||||
_ValuesT = TypeVar("_ValuesT", bound=Collection[Any], contravariant=True)
|
||||
|
||||
class ValidationError(ValueError):
|
||||
|
||||
@@ -1,2 +1,59 @@
|
||||
from wtforms.widgets.core import *
|
||||
from wtforms.widgets.core import Input as Input, html_params as html_params
|
||||
from wtforms.widgets.core import (
|
||||
CheckboxInput as CheckboxInput,
|
||||
ColorInput as ColorInput,
|
||||
DateInput as DateInput,
|
||||
DateTimeInput as DateTimeInput,
|
||||
DateTimeLocalInput as DateTimeLocalInput,
|
||||
EmailInput as EmailInput,
|
||||
FileInput as FileInput,
|
||||
HiddenInput as HiddenInput,
|
||||
Input as Input,
|
||||
ListWidget as ListWidget,
|
||||
MonthInput as MonthInput,
|
||||
NumberInput as NumberInput,
|
||||
Option as Option,
|
||||
PasswordInput as PasswordInput,
|
||||
RadioInput as RadioInput,
|
||||
RangeInput as RangeInput,
|
||||
SearchInput as SearchInput,
|
||||
Select as Select,
|
||||
SubmitInput as SubmitInput,
|
||||
TableWidget as TableWidget,
|
||||
TelInput as TelInput,
|
||||
TextArea as TextArea,
|
||||
TextInput as TextInput,
|
||||
TimeInput as TimeInput,
|
||||
URLInput as URLInput,
|
||||
WeekInput as WeekInput,
|
||||
html_params as html_params,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"CheckboxInput",
|
||||
"ColorInput",
|
||||
"DateInput",
|
||||
"DateTimeInput",
|
||||
"DateTimeLocalInput",
|
||||
"EmailInput",
|
||||
"FileInput",
|
||||
"HiddenInput",
|
||||
"ListWidget",
|
||||
"MonthInput",
|
||||
"NumberInput",
|
||||
"Option",
|
||||
"PasswordInput",
|
||||
"RadioInput",
|
||||
"RangeInput",
|
||||
"SearchInput",
|
||||
"Select",
|
||||
"SubmitInput",
|
||||
"TableWidget",
|
||||
"TextArea",
|
||||
"TextInput",
|
||||
"TelInput",
|
||||
"TimeInput",
|
||||
"URLInput",
|
||||
"WeekInput",
|
||||
"html_params",
|
||||
"Input",
|
||||
]
|
||||
|
||||
@@ -2,8 +2,8 @@ from decimal import Decimal
|
||||
from typing import Any, Literal
|
||||
|
||||
from markupsafe import Markup
|
||||
from wtforms.fields import Field, FormField, SelectFieldBase, StringField
|
||||
from wtforms.fields.choices import _Option
|
||||
from wtforms.fields import Field, FormField, StringField
|
||||
from wtforms.fields.choices import SelectFieldBase, _Option
|
||||
|
||||
__all__ = (
|
||||
"CheckboxInput",
|
||||
|
||||
Reference in New Issue
Block a user