mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-15 16:27:09 +08:00
Add ValidationError type hints (#767)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Dict, Iterator, List, Mapping, Optional, Tuple, Union
|
||||
from typing import Any, Dict, Iterator, List, Literal, Mapping, Optional, Tuple, Union
|
||||
|
||||
from django.forms.utils import ErrorDict
|
||||
|
||||
@@ -24,15 +24,20 @@ class MiddlewareNotUsed(Exception): ...
|
||||
class ImproperlyConfigured(Exception): ...
|
||||
class FieldError(Exception): ...
|
||||
|
||||
NON_FIELD_ERRORS: str
|
||||
NON_FIELD_ERRORS: Literal["__all__"]
|
||||
|
||||
class ValidationError(Exception):
|
||||
error_dict: Any = ...
|
||||
error_list: Any = ...
|
||||
message: Any = ...
|
||||
code: Any = ...
|
||||
params: Any = ...
|
||||
def __init__(self, message: Any, code: Optional[str] = ..., params: Optional[Mapping[str, Any]] = ...) -> None: ...
|
||||
error_dict: Dict[str, ValidationError] = ...
|
||||
error_list: List[ValidationError] = ...
|
||||
message: str = ...
|
||||
code: Optional[str] = ...
|
||||
params: Optional[Mapping[str, Any]] = ...
|
||||
def __init__(
|
||||
self,
|
||||
message: Union[str, ValidationError, Dict[str, Any], List[Any]],
|
||||
code: Optional[str] = ...,
|
||||
params: Optional[Mapping[str, Any]] = ...,
|
||||
) -> None: ...
|
||||
@property
|
||||
def message_dict(self) -> Dict[str, List[str]]: ...
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user