mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-11 06:21:58 +08:00
improved version
This commit is contained in:
@@ -3,6 +3,7 @@ from datetime import (
|
||||
time,
|
||||
timedelta,
|
||||
)
|
||||
from decimal import Decimal
|
||||
from django.utils.safestring import SafeText
|
||||
from typing import (
|
||||
Any,
|
||||
@@ -19,8 +20,8 @@ def _property_resolver(arg: Union[str, int]) -> Callable: ...
|
||||
|
||||
|
||||
def add(
|
||||
value: Union[str, Tuple[int, int], date, int],
|
||||
arg: Union[int, timedelta, Tuple[int, int], SafeText]
|
||||
value: Union[date, Tuple[int, int], str, int],
|
||||
arg: Union[SafeText, Tuple[int, int], timedelta, int]
|
||||
) -> Union[str, Tuple[int, int, int, int], date, int]: ...
|
||||
|
||||
|
||||
@@ -39,7 +40,7 @@ def cut(value: str, arg: str) -> str: ...
|
||||
def date(value: Optional[Union[time, date, str]], arg: Optional[str] = ...) -> str: ...
|
||||
|
||||
|
||||
def default(value: Optional[Union[str, int]], arg: Union[int, SafeText]) -> Union[str, int]: ...
|
||||
def default(value: Optional[Union[int, str]], arg: Union[SafeText, int]) -> Union[int, str]: ...
|
||||
|
||||
|
||||
def default_if_none(value: Optional[str], arg: Union[str, int]) -> Union[str, int]: ...
|
||||
@@ -69,7 +70,7 @@ def filesizeformat(bytes_: Union[str, int]) -> str: ...
|
||||
def first(value: Union[str, List[str]]) -> str: ...
|
||||
|
||||
|
||||
def floatformat(text: Any, arg: Union[str, int] = ...) -> str: ...
|
||||
def floatformat(text: Optional[Union[Decimal, str, float]], arg: Union[str, int] = ...) -> str: ...
|
||||
|
||||
|
||||
def force_escape(value: str) -> SafeText: ...
|
||||
@@ -93,7 +94,7 @@ def last(value: List[str]) -> str: ...
|
||||
def length(value: Any) -> int: ...
|
||||
|
||||
|
||||
def length_is(value: Any, arg: Union[int, SafeText]) -> Union[bool, str]: ...
|
||||
def length_is(value: Any, arg: Union[SafeText, int]) -> Union[bool, str]: ...
|
||||
|
||||
|
||||
def linebreaks_filter(value: str, autoescape: bool = ...) -> SafeText: ...
|
||||
@@ -105,7 +106,7 @@ def linebreaksbr(value: str, autoescape: bool = ...) -> SafeText: ...
|
||||
def linenumbers(value: str, autoescape: bool = ...) -> SafeText: ...
|
||||
|
||||
|
||||
def ljust(value: str, arg: Union[int, SafeText]) -> str: ...
|
||||
def ljust(value: str, arg: Union[SafeText, int]) -> str: ...
|
||||
|
||||
|
||||
def lower(value: str) -> str: ...
|
||||
@@ -123,10 +124,10 @@ def pluralize(value: object, arg: str = ...) -> str: ...
|
||||
def pprint(value: object) -> str: ...
|
||||
|
||||
|
||||
def random(value: Union[List[SafeText], List[str]]) -> str: ...
|
||||
def random(value: Union[List[str], List[SafeText]]) -> str: ...
|
||||
|
||||
|
||||
def rjust(value: str, arg: Union[int, SafeText]) -> str: ...
|
||||
def rjust(value: str, arg: Union[SafeText, int]) -> str: ...
|
||||
|
||||
|
||||
def safe(value: str) -> SafeText: ...
|
||||
@@ -159,13 +160,13 @@ def timeuntil_filter(value: date, arg: Optional[date] = ...) -> str: ...
|
||||
def title(value: str) -> str: ...
|
||||
|
||||
|
||||
def truncatechars(value: str, arg: Union[int, SafeText]) -> str: ...
|
||||
def truncatechars(value: str, arg: Union[SafeText, int]) -> str: ...
|
||||
|
||||
|
||||
def truncatechars_html(value: str, arg: Union[str, int]) -> str: ...
|
||||
|
||||
|
||||
def truncatewords(value: str, arg: Union[int, SafeText]) -> str: ...
|
||||
def truncatewords(value: str, arg: Union[SafeText, int]) -> str: ...
|
||||
|
||||
|
||||
def truncatewords_html(value: str, arg: int) -> str: ...
|
||||
@@ -185,7 +186,7 @@ def urlize(value: str, autoescape: bool = ...) -> SafeText: ...
|
||||
|
||||
def urlizetrunc(
|
||||
value: str,
|
||||
limit: Union[int, SafeText],
|
||||
limit: Union[SafeText, int],
|
||||
autoescape: bool = ...
|
||||
) -> SafeText: ...
|
||||
|
||||
@@ -193,7 +194,7 @@ def urlizetrunc(
|
||||
def wordcount(value: str) -> int: ...
|
||||
|
||||
|
||||
def wordwrap(value: str, arg: Union[int, SafeText]) -> str: ...
|
||||
def wordwrap(value: str, arg: Union[SafeText, int]) -> str: ...
|
||||
|
||||
|
||||
def yesno(value: Optional[int], arg: Optional[str] = ...) -> Optional[str]: ...
|
||||
Reference in New Issue
Block a user