mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-08 21:14:49 +08:00
52 lines
1.5 KiB
Python
52 lines
1.5 KiB
Python
from datetime import datetime
|
|
from django.core.exceptions import ValidationError
|
|
from django.utils.safestring import SafeText
|
|
from typing import (
|
|
Callable,
|
|
Dict,
|
|
List,
|
|
Optional,
|
|
Tuple,
|
|
Type,
|
|
Union,
|
|
)
|
|
|
|
|
|
def flatatt(attrs: Dict[str, Union[str, None]]) -> SafeText: ...
|
|
|
|
|
|
def from_current_timezone(value: datetime) -> datetime: ...
|
|
|
|
|
|
def pretty_name(name: str) -> str: ...
|
|
|
|
|
|
def to_current_timezone(value: datetime) -> datetime: ...
|
|
|
|
|
|
class ErrorDict:
|
|
def as_data(self) -> Dict[str, List[ValidationError]]: ...
|
|
def as_json(self, escape_html: bool = ...) -> str: ...
|
|
def as_ul(self) -> SafeText: ...
|
|
def get_json_data(self, escape_html: bool = ...) -> Dict[str, List[Dict[str, str]]]: ...
|
|
|
|
|
|
class ErrorList:
|
|
def __contains__(self, item: str) -> bool: ...
|
|
def __eq__(self, other: Union[List[str], ErrorList]) -> bool: ...
|
|
def __getitem__(self, i: Union[str, int]) -> str: ...
|
|
def __init__(
|
|
self,
|
|
initlist: Optional[Union[List[ValidationError], ErrorList, List[str]]] = ...,
|
|
error_class: Optional[str] = ...
|
|
) -> None: ...
|
|
def __reduce_ex__(
|
|
self,
|
|
*args,
|
|
**kwargs
|
|
) -> Tuple[Callable, Tuple[Type[ErrorList]], Dict[str, Union[List[ValidationError], str]], None, None]: ...
|
|
def __repr__(self) -> str: ...
|
|
def as_data(self) -> List[ValidationError]: ...
|
|
def as_text(self) -> str: ...
|
|
def as_ul(self) -> str: ...
|
|
def get_json_data(self, escape_html: bool = ...) -> List[Dict[str, str]]: ... |