mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-08 04:54:48 +08:00
Use less specific types in validators args (#49)
This commit is contained in:
committed by
Maxim Kurnikov
parent
b1a04d2f7d
commit
4f83d8d1bb
@@ -1,7 +1,7 @@
|
||||
from datetime import datetime
|
||||
from decimal import Decimal
|
||||
from re import RegexFlag
|
||||
from typing import Any, Dict, List, Optional, Union, Pattern
|
||||
from typing import Any, Dict, List, Optional, Union, Pattern, Collection
|
||||
from uuid import UUID
|
||||
|
||||
from django.core.files.base import File
|
||||
@@ -38,7 +38,7 @@ class URLValidator(RegexValidator):
|
||||
tld_re: Any = ...
|
||||
host_re: Any = ...
|
||||
schemes: Any = ...
|
||||
def __init__(self, schemes: Optional[List[str]] = ..., **kwargs: Any) -> None: ...
|
||||
def __init__(self, schemes: Optional[Collection[str]] = ..., **kwargs: Any) -> None: ...
|
||||
|
||||
integer_validator: Any
|
||||
|
||||
@@ -52,7 +52,7 @@ class EmailValidator:
|
||||
literal_regex: Any = ...
|
||||
domain_whitelist: Any = ...
|
||||
def __init__(
|
||||
self, message: Optional[str] = ..., code: Optional[str] = ..., whitelist: Optional[List[str]] = ...
|
||||
self, message: Optional[str] = ..., code: Optional[str] = ..., whitelist: Optional[Collection[str]] = ...
|
||||
) -> None: ...
|
||||
def __call__(self, value: Optional[str]) -> None: ...
|
||||
def validate_domain_part(self, domain_part: str) -> bool: ...
|
||||
@@ -119,7 +119,10 @@ class FileExtensionValidator:
|
||||
code: str = ...
|
||||
allowed_extensions: List[str] = ...
|
||||
def __init__(
|
||||
self, allowed_extensions: Optional[List[str]] = ..., message: Optional[str] = ..., code: Optional[str] = ...
|
||||
self,
|
||||
allowed_extensions: Optional[Collection[str]] = ...,
|
||||
message: Optional[str] = ...,
|
||||
code: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
def __call__(self, value: File) -> None: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user