mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-18 09:56:00 +08:00
various fixes
This commit is contained in:
@@ -33,14 +33,7 @@ class ValidationError(Exception):
|
||||
params: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
message: Union[
|
||||
Dict[str, List[ValidationError]],
|
||||
Dict[str, ErrorList],
|
||||
List[Union[ValidationError, str]],
|
||||
ValidationError,
|
||||
ErrorList,
|
||||
str,
|
||||
],
|
||||
message: Any,
|
||||
code: Optional[str] = ...,
|
||||
params: Optional[
|
||||
Union[Dict[str, Union[Tuple[str], Type[Model], Model, str]], Dict[str, Union[int, str]]]
|
||||
|
||||
@@ -9,24 +9,25 @@ from django.utils.functional import SimpleLazyObject
|
||||
|
||||
EMPTY_VALUES: Any
|
||||
|
||||
def _lazy_re_compile(regex: Union[str, Pattern], flags: int = ...): ...
|
||||
_Regex = Union[str, Pattern[str]]
|
||||
|
||||
def _lazy_re_compile(regex: _Regex, flags: int = ...): ...
|
||||
|
||||
class RegexValidator:
|
||||
regex: SimpleLazyObject = ...
|
||||
regex: _Regex = ...
|
||||
message: Any = ...
|
||||
code: str = ...
|
||||
inverse_match: bool = ...
|
||||
flags: int = ...
|
||||
def __init__(
|
||||
self,
|
||||
regex: Optional[str] = ...,
|
||||
regex: Optional[_Regex] = ...,
|
||||
message: Optional[str] = ...,
|
||||
code: Optional[str] = ...,
|
||||
inverse_match: Optional[bool] = ...,
|
||||
flags: Optional[RegexFlag] = ...,
|
||||
) -> None: ...
|
||||
def __call__(self, value: Optional[Union[float, str]]) -> None: ...
|
||||
def __eq__(self, other: Union[ProhibitNullCharactersValidator, RegexValidator]) -> bool: ...
|
||||
|
||||
class URLValidator(RegexValidator):
|
||||
ul: str = ...
|
||||
@@ -36,8 +37,6 @@ class URLValidator(RegexValidator):
|
||||
domain_re: Any = ...
|
||||
tld_re: Any = ...
|
||||
host_re: Any = ...
|
||||
regex: SimpleLazyObject = ...
|
||||
message: Any = ...
|
||||
schemes: Any = ...
|
||||
def __init__(self, schemes: Optional[List[str]] = ..., **kwargs: Any) -> None: ...
|
||||
def __call__(self, value: str) -> None: ...
|
||||
@@ -58,7 +57,6 @@ class EmailValidator:
|
||||
) -> None: ...
|
||||
def __call__(self, value: Optional[str]) -> None: ...
|
||||
def validate_domain_part(self, domain_part: str) -> bool: ...
|
||||
def __eq__(self, other: EmailValidator) -> bool: ...
|
||||
|
||||
validate_email: Any
|
||||
slug_re: Any
|
||||
@@ -83,13 +81,10 @@ class BaseValidator:
|
||||
message: Any = ...
|
||||
code: str = ...
|
||||
limit_value: bool = ...
|
||||
def __init__(
|
||||
self, limit_value: Optional[Union[datetime, Decimal, float, str]], message: Optional[str] = ...
|
||||
) -> None: ...
|
||||
def __call__(self, value: Union[bytes, datetime, Decimal, float, str]) -> None: ...
|
||||
def __eq__(self, other: BaseValidator) -> bool: ...
|
||||
def __init__(self, limit_value: Any, message: Optional[str] = ...) -> None: ...
|
||||
def __call__(self, value: Any) -> None: ...
|
||||
def compare(self, a: bool, b: bool) -> bool: ...
|
||||
def clean(self, x: Union[datetime, Decimal, float]) -> Union[datetime, Decimal, float]: ...
|
||||
def clean(self, x: Any) -> Any: ...
|
||||
|
||||
class MaxValueValidator(BaseValidator):
|
||||
limit_value: Decimal
|
||||
@@ -123,7 +118,6 @@ class DecimalValidator:
|
||||
decimal_places: int = ...
|
||||
def __init__(self, max_digits: Optional[Union[int, str]], decimal_places: Optional[Union[int, str]]) -> None: ...
|
||||
def __call__(self, value: Decimal) -> None: ...
|
||||
def __eq__(self, other: Union[DecimalValidator, MinValueValidator]) -> bool: ...
|
||||
|
||||
class FileExtensionValidator:
|
||||
message: Any = ...
|
||||
@@ -133,7 +127,6 @@ class FileExtensionValidator:
|
||||
self, allowed_extensions: Optional[List[str]] = ..., message: Optional[str] = ..., code: Optional[str] = ...
|
||||
) -> None: ...
|
||||
def __call__(self, value: File) -> None: ...
|
||||
def __eq__(self, other: FileExtensionValidator) -> bool: ...
|
||||
|
||||
def get_available_image_extensions() -> List[str]: ...
|
||||
def validate_image_file_extension(value: File) -> None: ...
|
||||
@@ -143,4 +136,3 @@ class ProhibitNullCharactersValidator:
|
||||
code: str = ...
|
||||
def __init__(self, message: Optional[str] = ..., code: Optional[str] = ...) -> None: ...
|
||||
def __call__(self, value: Optional[Union[Dict[Any, Any], str, UUID]]) -> None: ...
|
||||
def __eq__(self, other: Union[ProhibitNullCharactersValidator, RegexValidator]) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user