mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-09-01 12:27:01 +08:00
third iteration of stubs
This commit is contained in:
@@ -1,11 +1,108 @@
|
||||
from typing import Any, List, Optional, Union
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
from django.utils.functional import LazyObject
|
||||
|
||||
ENVIRONMENT_VARIABLE: str
|
||||
|
||||
class LazySettings(LazyObject):
|
||||
def __getattr__(self, name: str) -> Any: ...
|
||||
def __getattr__(
|
||||
self, name: str
|
||||
) -> Optional[
|
||||
Union[
|
||||
Callable,
|
||||
Dict[int, None],
|
||||
Dict[int, str],
|
||||
Dict[str, Callable],
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
Dict[str, Union[Callable, Dict[str, int], str]],
|
||||
Dict[str, Union[Dict[str, int], int, str]],
|
||||
]
|
||||
],
|
||||
],
|
||||
Dict[str, Optional[str]],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[Dict[Any, Any], Dict[str, None], int, str]
|
||||
],
|
||||
],
|
||||
str,
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Union[List[str], bool, str]],
|
||||
Dict[str, Union[List[str], str]],
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Union[Dict[str, Union[List[str], str]], Dict[str, str]],
|
||||
],
|
||||
int,
|
||||
str,
|
||||
],
|
||||
],
|
||||
List[Dict[str, Union[Dict[str, List[Any]], List[Any], bool, str]]],
|
||||
List[Dict[str, Union[Dict[str, Tuple[str]], List[str], str]]],
|
||||
List[
|
||||
Union[
|
||||
Dict[str, Union[Dict[Any, Any], bool, str]],
|
||||
Dict[str, Union[Dict[str, bool], bool, str]],
|
||||
]
|
||||
],
|
||||
List[
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[Dict[str, List[Tuple[str, Dict[str, str]]]], str],
|
||||
],
|
||||
Dict[str, Union[Dict[str, int], str]],
|
||||
]
|
||||
],
|
||||
List[
|
||||
Union[
|
||||
Dict[
|
||||
str, Union[Dict[str, List[str]], List[str], bool, str]
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Union[Dict[str, Tuple[str, str]], List[str], bool, str],
|
||||
],
|
||||
]
|
||||
],
|
||||
List[
|
||||
Union[
|
||||
Dict[str, Union[Dict[str, bool], str]],
|
||||
Dict[str, Union[Dict[str, int], str]],
|
||||
]
|
||||
],
|
||||
List[
|
||||
Union[
|
||||
Dict[str, Union[Dict[str, int], str]],
|
||||
Dict[str, Union[Dict[str, str], str]],
|
||||
]
|
||||
],
|
||||
List[Union[Tuple[str, str], str]],
|
||||
List[int],
|
||||
Tuple[Tuple[str, str], Tuple[str, str]],
|
||||
Tuple[str, str],
|
||||
Type[Any],
|
||||
float,
|
||||
int,
|
||||
str,
|
||||
]
|
||||
]: ...
|
||||
def __setattr__(self, name: str, value: Any) -> None: ...
|
||||
def __delattr__(self, name: str) -> None: ...
|
||||
def configure(self, default_settings: Any = ..., **options: Any) -> Any: ...
|
||||
@@ -27,8 +124,136 @@ class UserSettingsHolder:
|
||||
def __init__(
|
||||
self, default_settings: Union[Settings, UserSettingsHolder]
|
||||
) -> None: ...
|
||||
def __getattr__(self, name: str) -> Any: ...
|
||||
def __setattr__(self, name: str, value: Any) -> None: ...
|
||||
def __getattr__(
|
||||
self, name: str
|
||||
) -> Optional[
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Dict[
|
||||
str,
|
||||
Optional[Union[Dict[Any, Any], Dict[str, None], int, str]],
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Union[List[str], bool, str]],
|
||||
Dict[str, Union[List[str], str]],
|
||||
],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Union[List[str], str]], Dict[str, str]
|
||||
],
|
||||
],
|
||||
int,
|
||||
]
|
||||
],
|
||||
],
|
||||
Dict[str, str],
|
||||
List[Dict[str, Union[Dict[str, List[str]], List[str], bool, str]]],
|
||||
List[Dict[str, Union[Dict[str, Tuple[str]], List[str], bool, str]]],
|
||||
List[Union[Tuple[str, str], str]],
|
||||
List[int],
|
||||
float,
|
||||
int,
|
||||
str,
|
||||
]
|
||||
]: ...
|
||||
def __setattr__(
|
||||
self,
|
||||
name: str,
|
||||
value: Optional[
|
||||
Union[
|
||||
Callable,
|
||||
Dict[int, None],
|
||||
Dict[int, str],
|
||||
Dict[str, Callable],
|
||||
Dict[
|
||||
str,
|
||||
Optional[
|
||||
Union[
|
||||
Dict[str, Dict[str, Union[List[str], bool, str]]],
|
||||
int,
|
||||
]
|
||||
],
|
||||
],
|
||||
Dict[str, Optional[str]],
|
||||
Dict[str, Union[Dict[str, Optional[str]], str]],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Union[Callable, Dict[str, int], str]],
|
||||
Dict[str, Union[Dict[str, int], int, str]],
|
||||
],
|
||||
],
|
||||
List[
|
||||
Dict[str, Union[Dict[str, List[Any]], List[Any], bool, str]]
|
||||
],
|
||||
List[Dict[str, Union[Dict[str, Tuple[str]], List[str], str]]],
|
||||
List[
|
||||
Union[
|
||||
Dict[str, Union[Dict[Any, Any], bool, str]],
|
||||
Dict[str, Union[Dict[str, bool], bool, str]],
|
||||
]
|
||||
],
|
||||
List[
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, List[Tuple[str, Dict[str, str]]]], str
|
||||
],
|
||||
],
|
||||
Dict[str, Union[Dict[str, int], str]],
|
||||
]
|
||||
],
|
||||
List[
|
||||
Union[
|
||||
Dict[
|
||||
str,
|
||||
Union[Dict[str, List[str]], List[str], bool, str],
|
||||
],
|
||||
Dict[
|
||||
str,
|
||||
Union[
|
||||
Dict[str, Tuple[str, str]], List[str], bool, str
|
||||
],
|
||||
],
|
||||
]
|
||||
],
|
||||
List[
|
||||
Union[
|
||||
Dict[str, Union[Dict[str, bool], str]],
|
||||
Dict[str, Union[Dict[str, int], str]],
|
||||
]
|
||||
],
|
||||
List[
|
||||
Union[
|
||||
Dict[str, Union[Dict[str, int], str]],
|
||||
Dict[str, Union[Dict[str, str], str]],
|
||||
]
|
||||
],
|
||||
List[Union[Tuple[str, str], str]],
|
||||
List[int],
|
||||
Tuple[Tuple[str, str], Tuple[str, str]],
|
||||
Tuple[str],
|
||||
Type[Any],
|
||||
bytes,
|
||||
Settings,
|
||||
UserSettingsHolder,
|
||||
float,
|
||||
int,
|
||||
str,
|
||||
]
|
||||
],
|
||||
) -> None: ...
|
||||
def __delattr__(self, name: str) -> None: ...
|
||||
def __dir__(self) -> List[str]: ...
|
||||
def is_overridden(self, setting: str) -> bool: ...
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from typing import Any, Callable, Optional, Tuple, Union
|
||||
from typing import Any, Callable, Dict, Optional, Tuple, Type, Union
|
||||
|
||||
from django.contrib.sitemaps import Sitemap
|
||||
from django.urls import include as include
|
||||
from django.urls.resolvers import URLPattern, URLResolver
|
||||
|
||||
@@ -11,8 +12,14 @@ handler500: Any
|
||||
def url(
|
||||
regex: str,
|
||||
view: Optional[
|
||||
Union[Tuple[None, None, None], Tuple[str, str, str], Callable]
|
||||
Union[Callable, Tuple[None, None, None], Tuple[str, str, str]]
|
||||
],
|
||||
kwargs: Any = ...,
|
||||
kwargs: Optional[
|
||||
Union[
|
||||
Dict[str, Dict[str, Sitemap]],
|
||||
Dict[str, Union[Dict[str, Type[Sitemap]], str]],
|
||||
Dict[str, Union[int, str]],
|
||||
]
|
||||
] = ...,
|
||||
name: Optional[str] = ...,
|
||||
) -> Union[URLResolver, URLPattern]: ...
|
||||
) -> Union[URLPattern, URLResolver]: ...
|
||||
|
||||
@@ -5,7 +5,7 @@ from django.urls.resolvers import URLPattern, URLResolver
|
||||
|
||||
def i18n_patterns(
|
||||
*urls: Any, prefix_default_language: bool = ...
|
||||
) -> Union[List[URLPattern], List[List[Any]], List[URLResolver]]: ...
|
||||
) -> Union[List[List[Any]], List[URLPattern], List[URLResolver]]: ...
|
||||
def is_language_prefix_patterns_used(urlconf: str) -> Tuple[bool, bool]: ...
|
||||
|
||||
urlpatterns: Any
|
||||
|
||||
Reference in New Issue
Block a user