mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-10 22:11:54 +08:00
Compare commits
79 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5832605053 | ||
|
|
31e795016f | ||
|
|
0cba3f9fd6 | ||
|
|
f02050911f | ||
|
|
e8e6fca78c | ||
|
|
ade48b6546 | ||
|
|
b8f29027d8 | ||
|
|
eba3f6cb15 | ||
|
|
5a45544e76 | ||
|
|
8c2de7da56 | ||
|
|
d43c6dc7e2 | ||
|
|
f7e2109e06 | ||
|
|
cea62abf5a | ||
|
|
3b69ec6a72 | ||
|
|
7e794534c0 | ||
|
|
f5f33b061d | ||
|
|
58b26fdbd3 | ||
|
|
9ca79c24a2 | ||
|
|
540e28f4c6 | ||
|
|
4ac43c6ed6 | ||
|
|
cadd6c963b | ||
|
|
041754f817 | ||
|
|
c0c5d1e588 | ||
|
|
f824003cc4 | ||
|
|
58f1833cab | ||
|
|
cbb6a7a9ac | ||
|
|
2c4827bbaf | ||
|
|
5a151bf851 | ||
|
|
cbc7159995 | ||
|
|
df4c17a947 | ||
|
|
445abc046c | ||
|
|
557b7a4fa3 | ||
|
|
8343d76895 | ||
|
|
8d986a0f43 | ||
|
|
e9a90ebff0 | ||
|
|
7b74a6944a | ||
|
|
83f11a0fc6 | ||
|
|
2829faf1af | ||
|
|
d061e84cc7 | ||
|
|
3a9263dc62 | ||
|
|
14aea2b4d4 | ||
|
|
287c64d6fb | ||
|
|
6601121db2 | ||
|
|
87d59c7c1a | ||
|
|
8402e7c53e | ||
|
|
dceb075152 | ||
|
|
7e3f4bfa02 | ||
|
|
db9ff6aaf6 | ||
|
|
717be5940f | ||
|
|
b939bc96b7 | ||
|
|
02bdf5be95 | ||
|
|
4d4b0003bd | ||
|
|
e143ba568c | ||
|
|
32c0cbca45 | ||
|
|
acc3ca4205 | ||
|
|
be3fc259d5 | ||
|
|
7725b416b6 | ||
|
|
2c23d8e70f | ||
|
|
5910bd1b25 | ||
|
|
963d50c717 | ||
|
|
7407b93151 | ||
|
|
afcd0d9293 | ||
|
|
a85dbff793 | ||
|
|
68aebe2528 | ||
|
|
d3dca5b408 | ||
|
|
c69090ec5b | ||
|
|
29ac1c3017 | ||
|
|
23ad65033b | ||
|
|
64720f492c | ||
|
|
a8fdd4c673 | ||
|
|
813dd8cc1a | ||
|
|
2b53fa5a1a | ||
|
|
e3ea84143f | ||
|
|
82e3aa5464 | ||
|
|
5b9a467cf0 | ||
|
|
4a4dc53c4d | ||
|
|
77fd46987d | ||
|
|
9291164a6b | ||
|
|
0c3e06e875 |
35
.github/ISSUE_TEMPLATE/bug.md
vendored
Normal file
35
.github/ISSUE_TEMPLATE/bug.md
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
name: Bug
|
||||
about: Create a report of something is not working
|
||||
labels: 'bug'
|
||||
---
|
||||
|
||||
# Bug report
|
||||
|
||||
<!--
|
||||
Hi, thanks for submitting a bug. We appreciate that.
|
||||
|
||||
But, we will need some information about what's wrong to help you.
|
||||
-->
|
||||
|
||||
## What's wrong
|
||||
|
||||
<!--
|
||||
Describe what is not working.
|
||||
|
||||
Please, attach a traceback.
|
||||
We would also appreciate a failing test case.
|
||||
That is EXTREMELY helpful!
|
||||
-->
|
||||
|
||||
## How is that should be
|
||||
|
||||
<!-- Describe how it should work. -->
|
||||
|
||||
## System information
|
||||
|
||||
- OS:
|
||||
- `python` version:
|
||||
- `django` version:
|
||||
- `mypy` version:
|
||||
- `django-stubs` version:
|
||||
29
.github/pull_request_template.md
vendored
Normal file
29
.github/pull_request_template.md
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
# I have made things!
|
||||
|
||||
<!--
|
||||
Hi, thanks for submitting a Pull Request. We appreciate it.
|
||||
|
||||
Please, fill in all the required information
|
||||
to make our review and merging processes easier.
|
||||
|
||||
Cheers!
|
||||
-->
|
||||
|
||||
## Related issues
|
||||
|
||||
<!--
|
||||
Mark what issues this Pull Request closes or references.
|
||||
|
||||
Format is:
|
||||
- Closes #issue-number
|
||||
- Refs #issue-number
|
||||
|
||||
Example. Refs #0
|
||||
Documentation: https://blog.github.com/2013-05-14-closing-issues-via-pull-requests/
|
||||
-->
|
||||
|
||||
<!--
|
||||
If you have any feedback, just write it here.
|
||||
|
||||
It can be whatever you want!
|
||||
-->
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -8,4 +8,7 @@ out/
|
||||
build/
|
||||
dist/
|
||||
pip-wheel-metadata/
|
||||
.pytest_cache/
|
||||
.pytest_cache/
|
||||
/.envrc
|
||||
/.direnv
|
||||
django-sources/
|
||||
4
.gitmodules
vendored
4
.gitmodules
vendored
@@ -1,4 +0,0 @@
|
||||
[submodule "django-sources"]
|
||||
path = django-sources
|
||||
url = https://github.com/django/django.git
|
||||
branch = stable/2.2.x
|
||||
33
.travis.yml
33
.travis.yml
@@ -6,17 +6,22 @@ jobs:
|
||||
include:
|
||||
- name: Run plugin test suite with python 3.7
|
||||
python: 3.7
|
||||
script: |
|
||||
set -e
|
||||
pytest
|
||||
script: 'pytest'
|
||||
|
||||
- name: Typecheck Django test suite with python 3.7
|
||||
- name: Typecheck Django 3.0 test suite with python 3.7
|
||||
python: 3.7
|
||||
script: 'python ./scripts/typecheck_tests.py'
|
||||
script: |
|
||||
python ./scripts/typecheck_tests.py --django_version=3.0
|
||||
|
||||
- name: Typecheck Django test suite with python 3.6
|
||||
- name: Typecheck Django 3.0 test suite with python 3.6
|
||||
python: 3.6
|
||||
script: 'python ./scripts/typecheck_tests.py'
|
||||
script: |
|
||||
python ./scripts/typecheck_tests.py --django_version=3.0
|
||||
|
||||
- name: Typecheck Django 2.2 test suite with python 3.7
|
||||
python: 3.7
|
||||
script: |
|
||||
python ./scripts/typecheck_tests.py --django_version=2.2
|
||||
|
||||
- name: Mypy for plugin code
|
||||
python: 3.7
|
||||
@@ -24,18 +29,24 @@ jobs:
|
||||
|
||||
- name: Lint with black
|
||||
python: 3.7
|
||||
script: 'black --check --line-length=120 django-stubs/'
|
||||
script: 'black --check django-stubs/'
|
||||
|
||||
- name: Lint plugin code with flake8
|
||||
python: 3.7
|
||||
script: 'flake8'
|
||||
|
||||
- name: Lint stubs with flake8-pyi and check for unused imports
|
||||
python: 3.7
|
||||
script: 'flake8 --config flake8-pyi.ini'
|
||||
|
||||
- name: Lint plugin code with isort
|
||||
python: 3.7
|
||||
script: 'isort --check'
|
||||
script: 'isort --check --diff'
|
||||
|
||||
before_install: |
|
||||
# Upgrade pip, setuptools, and wheel
|
||||
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable -y
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y binutils libproj-dev gdal-bin
|
||||
pip install -U pip setuptools wheel
|
||||
install: |
|
||||
pip install -r ./dev-requirements.txt
|
||||
pip install -r ./dev-requirements.txt
|
||||
|
||||
56
README.md
56
README.md
@@ -2,70 +2,84 @@
|
||||
|
||||
# pep484 stubs for Django framework
|
||||
|
||||
[](https://travis-ci.org/typeddjango/django-stubs)
|
||||
[](https://travis-ci.com/typeddjango/django-stubs)
|
||||
[](http://mypy-lang.org/)
|
||||
[](https://gitter.im/mypy-django/Lobby)
|
||||
|
||||
This package contains type stubs and mypy plugin to provide more precise static types and type inference for Django framework. Django uses some Python "magic" that makes having precise types for some code patterns problematic. This is why we need to accompany the stubs with mypy plugins. The final goal is to be able to get precise types for most common patterns.
|
||||
|
||||
Supports Python 3.6/3.7, and Django 2.1/2.2.
|
||||
|
||||
Could be run on earlier versions of Django, but expect some missing imports warnings.
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
```bash
|
||||
pip install django-stubs
|
||||
```
|
||||
|
||||
### WARNING: All configuration from pre-1.0.0 versions is dropped, use one below.
|
||||
|
||||
### WARNING: 1.0.0 breaks `dmypy`, if you need it, stay on the 0.12.x series.
|
||||
## Mypy compatibility
|
||||
|
||||
| django-stubs | mypy version | django version | python version
|
||||
| ------------ | ---- | ---- | ---- |
|
||||
| 1.3.0 | 0.750 | 2.2.x | ^3.6
|
||||
| 1.2.0 | 0.730 | 2.2.x | ^3.6
|
||||
| 1.1.0 | 0.720 | 2.2.x | ^3.6
|
||||
| 0.12.x | old semantic analyzer (<0.711), dmypy support | 2.1.x | ^3.6
|
||||
|
||||
|
||||
## Configuration
|
||||
|
||||
To make mypy aware of the plugin, you need to add
|
||||
|
||||
```
|
||||
```ini
|
||||
[mypy]
|
||||
plugins =
|
||||
mypy_django_plugin.main
|
||||
```
|
||||
|
||||
in your `mypy.ini` file.
|
||||
in your `mypy.ini` or `setup.cfg` [file](https://mypy.readthedocs.io/en/latest/config_file.html).
|
||||
|
||||
Plugin requires Django settings module (what you put into `DJANGO_SETTINGS_MODULE` variable) to be specified inside `mypy.ini` file.
|
||||
```
|
||||
Plugin also requires Django settings module (what you put into `DJANGO_SETTINGS_MODULE` variable) to be specified.
|
||||
|
||||
```ini
|
||||
[mypy]
|
||||
strict_optional = True
|
||||
|
||||
; this one is new
|
||||
# This one is new:
|
||||
[mypy.plugins.django-stubs]
|
||||
django_settings_module = mysettings
|
||||
```
|
||||
where `mysettings` is a value of `DJANGO_SETTINGS_MODULE` (with or without quotes)
|
||||
|
||||
Do you have trouble with mypy / the django plugin not finding your settings module? Try adding the root path of your project to your PYTHONPATH environment variable. If you use pipenv you can add the following to an `.env` file in your project root which pipenv will run automatically before executing any commands.:
|
||||
```
|
||||
PYTHONPATH=${PYTHONPATH}:${PWD}
|
||||
```
|
||||
Where `mysettings` is a value of `DJANGO_SETTINGS_MODULE` (with or without quotes)
|
||||
|
||||
New implementation uses Django runtime to extract models information, so it will crash, if your installed apps `models.py` is not correct. For this same reason, you cannot use `reveal_type` inside global scope of any Python file that will be executed for `django.setup()`.
|
||||
Current implementation uses Django runtime to extract models information, so it will crash, if your installed apps `models.py` is not correct. For this same reason, you cannot use `reveal_type` inside global scope of any Python file that will be executed for `django.setup()`.
|
||||
|
||||
In other words, if your `manage.py runserver` crashes, mypy will crash too.
|
||||
|
||||
This fully working [typed boilerplate](https://github.com/wemake-services/wemake-django-template) can serve you as an example.
|
||||
|
||||
|
||||
## Notes
|
||||
|
||||
Implementation monkey-patches Django to add `__class_getitem__` to the `Manager` class. If you'd use Python3.7 and do that too in your code, you can make things like
|
||||
```
|
||||
Type implementation monkey-patches Django to add `__class_getitem__` to the `Manager` class.
|
||||
If you would use Python3.7 and do that too in your code, you can make things like
|
||||
|
||||
```python
|
||||
class MyUserManager(models.Manager['MyUser']):
|
||||
pass
|
||||
|
||||
class MyUser(models.Model):
|
||||
objects = UserManager()
|
||||
objects = MyUserManager()
|
||||
```
|
||||
|
||||
work, which should make a error messages a bit better.
|
||||
|
||||
Otherwise, custom type will be created in mypy, named `MyUser__MyUserManager`, which will rewrite base manager as `models.Manager[User]` to make methods like `get_queryset()` and others return properly typed `QuerySet`.
|
||||
|
||||
|
||||
## To get help
|
||||
|
||||
We have Gitter here https://gitter.im/mypy-django/Lobby.
|
||||
We have Gitter here: <https://gitter.im/mypy-django/Lobby>
|
||||
|
||||
If you think you have more generic typing issue, please refer to https://github.com/python/mypy and their Gitter.
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
black
|
||||
pytest-mypy-plugins==1.0.3
|
||||
pytest-mypy-plugins==1.1.0
|
||||
psycopg2
|
||||
flake8
|
||||
isort==4.3.4
|
||||
flake8==3.7.9
|
||||
flake8-pyi==19.3.0
|
||||
isort==4.3.21
|
||||
gitpython==3.0.5
|
||||
-e .
|
||||
|
||||
Submodule django-sources deleted from 4d6449e125
@@ -1,5 +1,6 @@
|
||||
from typing import Any, Iterator, Type, Optional, Dict
|
||||
|
||||
from django.apps.registry import Apps
|
||||
from django.db.models.base import Model
|
||||
|
||||
MODELS_MODULE_NAME: str
|
||||
@@ -7,11 +8,11 @@ MODELS_MODULE_NAME: str
|
||||
class AppConfig:
|
||||
name: str = ...
|
||||
module: Optional[Any] = ...
|
||||
apps: None = ...
|
||||
apps: Optional[Apps] = ...
|
||||
label: str = ...
|
||||
verbose_name: str = ...
|
||||
path: str = ...
|
||||
models_module: None = ...
|
||||
models_module: Optional[str] = ...
|
||||
models: Dict[str, Type[Model]] = ...
|
||||
def __init__(self, app_name: str, app_module: Optional[Any]) -> None: ...
|
||||
@classmethod
|
||||
|
||||
@@ -1,24 +1,22 @@
|
||||
import threading
|
||||
from collections import OrderedDict
|
||||
from typing import Any, Callable, List, Optional, Tuple, Type, Union, Iterable, DefaultDict, Dict
|
||||
from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Type, Union
|
||||
|
||||
from django.db.migrations.state import AppConfigStub
|
||||
from django.db.models.base import Model
|
||||
|
||||
from .config import AppConfig
|
||||
|
||||
class Apps:
|
||||
all_models: "Dict[str, OrderedDict[str, Type[Model]]]" = ...
|
||||
app_configs: "OrderedDict[str, AppConfig]" = ...
|
||||
all_models: Dict[str, Dict[str, Type[Model]]] = ...
|
||||
app_configs: Dict[str, AppConfig] = ...
|
||||
stored_app_configs: List[Any] = ...
|
||||
apps_ready: bool = ...
|
||||
ready_event: threading.Event = ...
|
||||
loading: bool = ...
|
||||
_pending_operations: DefaultDict[Tuple[str, str], List]
|
||||
_pending_operations: Dict[Tuple[str, str], List]
|
||||
models_ready: bool = ...
|
||||
ready: bool = ...
|
||||
def __init__(self, installed_apps: Optional[Union[List[AppConfigStub], List[str], Tuple]] = ...) -> None: ...
|
||||
def populate(self, installed_apps: Union[List[AppConfigStub], List[str], Tuple] = ...) -> None: ...
|
||||
def __init__(self, installed_apps: Optional[Iterable[Union[AppConfig, str]]] = ...) -> None: ...
|
||||
def populate(self, installed_apps: Iterable[Union[AppConfig, str]] = ...) -> None: ...
|
||||
def check_apps_ready(self) -> None: ...
|
||||
def check_models_ready(self) -> None: ...
|
||||
def get_app_configs(self) -> Iterable[AppConfig]: ...
|
||||
@@ -31,9 +29,9 @@ class Apps:
|
||||
def get_containing_app_config(self, object_name: str) -> Optional[AppConfig]: ...
|
||||
def get_registered_model(self, app_label: str, model_name: str) -> Type[Model]: ...
|
||||
def get_swappable_settings_name(self, to_string: str) -> Optional[str]: ...
|
||||
def set_available_apps(self, available: List[str]) -> None: ...
|
||||
def set_available_apps(self, available: Iterable[str]) -> None: ...
|
||||
def unset_available_apps(self) -> None: ...
|
||||
def set_installed_apps(self, installed: Union[List[str], Tuple[str]]) -> None: ...
|
||||
def set_installed_apps(self, installed: Iterable[str]) -> None: ...
|
||||
def unset_installed_apps(self) -> None: ...
|
||||
def clear_cache(self) -> None: ...
|
||||
def lazy_model_operation(self, function: Callable, *model_keys: Any) -> None: ...
|
||||
|
||||
@@ -345,7 +345,7 @@ SESSION_COOKIE_PATH = "/"
|
||||
SESSION_COOKIE_HTTPONLY = True
|
||||
# Whether to set the flag restricting cookie leaks on cross-site requests.
|
||||
# This can be 'Lax', 'Strict', or None to disable the flag.
|
||||
SESSION_COOKIE_SAMESITE = "Lax"
|
||||
SESSION_COOKIE_SAMESITE: Optional[str] = ...
|
||||
# Whether to save the session data on every request.
|
||||
SESSION_SAVE_EVERY_REQUEST = False
|
||||
# Whether a user's session cookie expires when the Web browser is closed.
|
||||
@@ -413,7 +413,7 @@ CSRF_COOKIE_DOMAIN = None
|
||||
CSRF_COOKIE_PATH = "/"
|
||||
CSRF_COOKIE_SECURE = False
|
||||
CSRF_COOKIE_HTTPONLY = False
|
||||
CSRF_COOKIE_SAMESITE = "Lax"
|
||||
CSRF_COOKIE_SAMESITE: Optional[str] = ...
|
||||
CSRF_HEADER_NAME = "HTTP_X_CSRFTOKEN"
|
||||
CSRF_TRUSTED_ORIGINS: List[str] = ...
|
||||
CSRF_USE_SESSIONS = False
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
from typing import Any, List, Union
|
||||
from typing import Any, List, Union, Iterable, Optional
|
||||
|
||||
from django.contrib.admin.options import BaseModelAdmin, InlineModelAdmin, ModelAdmin
|
||||
from django.contrib.admin.options import BaseModelAdmin
|
||||
from django.core.checks.messages import Error
|
||||
|
||||
from django.apps.config import AppConfig
|
||||
|
||||
_CheckError = Union[str, Error]
|
||||
|
||||
def check_admin_app(app_configs: None, **kwargs: Any) -> List[_CheckError]: ...
|
||||
def check_admin_app(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[_CheckError]: ...
|
||||
def check_dependencies(**kwargs: Any) -> List[_CheckError]: ...
|
||||
|
||||
class BaseModelAdminChecks:
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from typing import Any, Callable, Optional
|
||||
from typing import Any, Callable, Optional, Type
|
||||
|
||||
def register(*models: Any, site: Optional[Any] = ...) -> Callable: ...
|
||||
from django.db.models.base import Model
|
||||
|
||||
def register(*models: Type[Model], site: Optional[Any] = ...) -> Callable: ...
|
||||
|
||||
@@ -24,7 +24,7 @@ class SimpleListFilter(ListFilter):
|
||||
parameter_name: Any = ...
|
||||
lookup_choices: Any = ...
|
||||
def value(self) -> Optional[str]: ...
|
||||
def lookups(self, request: Any, model_admin: Any) -> None: ...
|
||||
def lookups(self, request: Any, model_admin: Any) -> List[Tuple[Any, str]]: ...
|
||||
|
||||
class FieldListFilter(ListFilter):
|
||||
field: Field = ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union, Iterable
|
||||
|
||||
from django.contrib.auth.forms import AdminPasswordChangeForm
|
||||
from django.forms.boundfield import BoundField
|
||||
@@ -26,7 +26,7 @@ class AdminForm:
|
||||
form: AdminPasswordChangeForm,
|
||||
fieldsets: List[Tuple[None, Dict[str, List[str]]]],
|
||||
prepopulated_fields: Dict[Any, Any],
|
||||
readonly_fields: Any = ...,
|
||||
readonly_fields: Optional[Iterable[Any]] = ...,
|
||||
model_admin: Any = ...,
|
||||
) -> None: ...
|
||||
def __iter__(self) -> Iterator[Fieldset]: ...
|
||||
@@ -47,7 +47,7 @@ class Fieldset:
|
||||
self,
|
||||
form: Any,
|
||||
name: Optional[Any] = ...,
|
||||
readonly_fields: Any = ...,
|
||||
readonly_fields: Optional[Iterable[Any]] = ...,
|
||||
fields: Any = ...,
|
||||
classes: Any = ...,
|
||||
description: Optional[Any] = ...,
|
||||
@@ -64,7 +64,7 @@ class Fieldline:
|
||||
model_admin: Any = ...
|
||||
readonly_fields: Any = ...
|
||||
def __init__(
|
||||
self, form: Any, field: Any, readonly_fields: Optional[Any] = ..., model_admin: Optional[Any] = ...
|
||||
self, form: Any, field: Any, readonly_fields: Optional[Iterable[Any]] = ..., model_admin: Optional[Any] = ...
|
||||
) -> None: ...
|
||||
def __iter__(self) -> Iterator[Union[AdminField, AdminReadonlyField]]: ...
|
||||
def errors(self) -> SafeText: ...
|
||||
|
||||
@@ -56,7 +56,6 @@ class BaseModelAdmin:
|
||||
show_full_result_count: bool = ...
|
||||
checks_class: Any = ...
|
||||
def check(self, **kwargs: Any) -> List[Union[str, Error]]: ...
|
||||
def __init__(self) -> None: ...
|
||||
def formfield_for_dbfield(
|
||||
self, db_field: Field, request: Optional[HttpRequest], **kwargs: Any
|
||||
) -> Optional[Field]: ...
|
||||
@@ -87,14 +86,13 @@ class BaseModelAdmin:
|
||||
def get_sortable_by(self, request: HttpRequest) -> Union[List[Callable], List[str], Tuple]: ...
|
||||
def lookup_allowed(self, lookup: str, value: str) -> bool: ...
|
||||
def to_field_allowed(self, request: HttpRequest, to_field: str) -> bool: ...
|
||||
def has_add_permission(self, request: HttpRequest, obj: Optional[Model] = ...) -> bool: ...
|
||||
def has_add_permission(self, request: HttpRequest) -> bool: ...
|
||||
def has_change_permission(self, request: HttpRequest, obj: Optional[Model] = ...) -> bool: ...
|
||||
def has_delete_permission(self, request: HttpRequest, obj: Optional[Model] = ...) -> bool: ...
|
||||
def has_view_permission(self, request: HttpRequest, obj: Optional[Model] = ...) -> bool: ...
|
||||
def has_module_permission(self, request: HttpRequest) -> bool: ...
|
||||
|
||||
class ModelAdmin(BaseModelAdmin):
|
||||
formfield_overrides: Any
|
||||
list_display: Sequence[Union[str, Callable]] = ...
|
||||
list_display_links: Optional[Sequence[Union[str, Callable]]] = ...
|
||||
list_filter: Sequence[Union[str, Type[ListFilter], Tuple[str, Type[ListFilter]]]] = ...
|
||||
@@ -122,7 +120,6 @@ class ModelAdmin(BaseModelAdmin):
|
||||
actions_on_top: bool = ...
|
||||
actions_on_bottom: bool = ...
|
||||
actions_selection_counter: bool = ...
|
||||
checks_class: Any = ...
|
||||
model: Type[Model] = ...
|
||||
opts: Options = ...
|
||||
admin_site: AdminSite = ...
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Type, Union
|
||||
|
||||
from django.contrib.admin.options import ModelAdmin
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.db.models.base import Model
|
||||
from django.http.response import HttpResponse
|
||||
from django.template.response import TemplateResponse
|
||||
from django.urls.resolvers import URLPattern, URLResolver
|
||||
from django.urls.resolvers import URLResolver
|
||||
from django.utils.functional import LazyObject
|
||||
|
||||
from django.apps.config import AppConfig
|
||||
|
||||
all_sites: Any
|
||||
|
||||
class AlreadyRegistered(Exception): ...
|
||||
@@ -28,16 +30,16 @@ class AdminSite:
|
||||
name: str = ...
|
||||
_registry: Dict[Type[Model], ModelAdmin]
|
||||
def __init__(self, name: str = ...) -> None: ...
|
||||
def check(self, app_configs: None) -> List[Any]: ...
|
||||
def check(self, app_configs: Optional[Iterable[AppConfig]]) -> List[Any]: ...
|
||||
def register(
|
||||
self,
|
||||
model_or_iterable: Union[List[Type[Model]], Tuple[Type[Model]], Type[Model]],
|
||||
model_or_iterable: Union[Type[Model], Iterable[Type[Model]]],
|
||||
admin_class: Optional[Type[ModelAdmin]] = ...,
|
||||
**options: Any
|
||||
) -> None: ...
|
||||
def unregister(self, model_or_iterable: Type[Model]) -> None: ...
|
||||
def unregister(self, model_or_iterable: Union[Type[Model], Iterable[Type[Model]]]) -> None: ...
|
||||
def is_registered(self, model: Type[Model]) -> bool: ...
|
||||
def add_action(self, action: Callable, name: None = ...) -> None: ...
|
||||
def add_action(self, action: Callable, name: Optional[str] = ...) -> None: ...
|
||||
def disable_action(self, name: str) -> None: ...
|
||||
def get_action(self, name: str) -> Callable: ...
|
||||
@property
|
||||
@@ -52,14 +54,20 @@ class AdminSite:
|
||||
@property
|
||||
def urls(self) -> Tuple[List[URLResolver], str, str]: ...
|
||||
def each_context(self, request: Any): ...
|
||||
def password_change(self, request: WSGIRequest, extra_context: Dict[str, str] = ...) -> TemplateResponse: ...
|
||||
def password_change_done(self, request: WSGIRequest, extra_context: None = ...) -> TemplateResponse: ...
|
||||
def password_change(
|
||||
self, request: WSGIRequest, extra_context: Optional[Dict[str, Any]] = ...
|
||||
) -> TemplateResponse: ...
|
||||
def password_change_done(
|
||||
self, request: WSGIRequest, extra_context: Optional[Dict[str, Any]] = ...
|
||||
) -> TemplateResponse: ...
|
||||
def i18n_javascript(self, request: WSGIRequest, extra_context: Optional[Dict[Any, Any]] = ...) -> HttpResponse: ...
|
||||
def logout(self, request: WSGIRequest, extra_context: None = ...) -> TemplateResponse: ...
|
||||
def login(self, request: WSGIRequest, extra_context: None = ...) -> HttpResponse: ...
|
||||
def logout(self, request: WSGIRequest, extra_context: Optional[Dict[str, Any]] = ...) -> TemplateResponse: ...
|
||||
def login(self, request: WSGIRequest, extra_context: Optional[Dict[str, Any]] = ...) -> HttpResponse: ...
|
||||
def get_app_list(self, request: WSGIRequest) -> List[Any]: ...
|
||||
def index(self, request: WSGIRequest, extra_context: Optional[Dict[str, str]] = ...) -> TemplateResponse: ...
|
||||
def app_index(self, request: WSGIRequest, app_label: str, extra_context: None = ...) -> TemplateResponse: ...
|
||||
def index(self, request: WSGIRequest, extra_context: Optional[Dict[str, Any]] = ...) -> TemplateResponse: ...
|
||||
def app_index(
|
||||
self, request: WSGIRequest, app_label: str, extra_context: Optional[Dict[str, Any]] = ...
|
||||
) -> TemplateResponse: ...
|
||||
|
||||
class DefaultAdminSite(LazyObject): ...
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class ResultList(list):
|
||||
def results(cl: ChangeList) -> Iterator[ResultList]: ...
|
||||
def result_hidden_fields(cl: ChangeList) -> Iterator[BoundField]: ...
|
||||
def result_list(
|
||||
cl: ChangeList
|
||||
cl: ChangeList,
|
||||
) -> Dict[
|
||||
str, Union[List[Dict[str, Optional[Union[int, str]]]], List[ResultList], List[BoundField], ChangeList, int]
|
||||
]: ...
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
from django.contrib.admin.helpers import InlineAdminForm
|
||||
from django.contrib.admin.templatetags.base import InclusionAdminNode
|
||||
from django.template.base import Parser, Token
|
||||
from django.template.context import Context, RequestContext
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
register: Any
|
||||
|
||||
|
||||
@@ -9,12 +9,10 @@ from django.contrib.auth.forms import AdminPasswordChangeForm
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.deletion import Collector
|
||||
from django.db.models.fields.mixins import FieldCacheMixin
|
||||
from django.db.models.fields.reverse_related import ManyToOneRel
|
||||
from django.db.models.options import Options
|
||||
from django.db.models.query import QuerySet
|
||||
from django.forms.forms import BaseForm
|
||||
from django.utils.safestring import SafeText
|
||||
|
||||
from django.db.models.fields import Field, reverse_related
|
||||
|
||||
@@ -27,7 +25,7 @@ def unquote(s: str) -> str: ...
|
||||
def flatten(fields: Any) -> List[Union[Callable, str]]: ...
|
||||
def flatten_fieldsets(fieldsets: Any) -> List[Union[Callable, str]]: ...
|
||||
def get_deleted_objects(
|
||||
objs: QuerySet, request: WSGIRequest, admin_site: AdminSite
|
||||
objs: Sequence[Optional[Model]], request: WSGIRequest, admin_site: AdminSite
|
||||
) -> Tuple[List[Any], Dict[Any, Any], Set[Any], List[Any]]: ...
|
||||
|
||||
class NestedObjects(Collector):
|
||||
@@ -41,22 +39,14 @@ class NestedObjects(Collector):
|
||||
model_objs: Any = ...
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def add_edge(self, source: Optional[Model], target: Model) -> None: ...
|
||||
def collect(
|
||||
self,
|
||||
objs: Union[Sequence[Optional[Model]], QuerySet],
|
||||
source: Optional[Type[Model]] = ...,
|
||||
source_attr: Optional[str] = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def related_objects(self, related: ManyToOneRel, objs: List[Model]) -> QuerySet: ...
|
||||
def nested(self, format_callback: Callable = ...) -> Union[List[SafeText], List[int]]: ...
|
||||
def can_fast_delete(self, *args: Any, **kwargs: Any) -> bool: ...
|
||||
def related_objects(self, related: ManyToOneRel, objs: Sequence[Optional[Model]]) -> QuerySet: ...
|
||||
def nested(self, format_callback: Callable = ...) -> List[Any]: ...
|
||||
|
||||
def model_format_dict(obj: Any): ...
|
||||
def model_ngettext(obj: Union[Options, QuerySet], n: Optional[int] = ...) -> str: ...
|
||||
def lookup_field(
|
||||
name: Union[Callable, str], obj: Model, model_admin: BaseModelAdmin = ...
|
||||
) -> Tuple[Optional[Field], Callable, Callable]: ...
|
||||
) -> Tuple[Optional[Field], Any, Any]: ...
|
||||
def label_for_field(
|
||||
name: Union[Callable, str],
|
||||
model: Type[Model],
|
||||
@@ -65,16 +55,14 @@ def label_for_field(
|
||||
form: Optional[BaseForm] = ...,
|
||||
) -> Union[Tuple[Optional[str], Union[Callable, Type[str]]], str]: ...
|
||||
def help_text_for_field(name: str, model: Type[Model]) -> str: ...
|
||||
def display_for_field(
|
||||
value: Any, field: Union[Field, reverse_related.OneToOneRel], empty_value_display: str
|
||||
) -> str: ...
|
||||
def display_for_field(value: Any, field: Field, empty_value_display: str) -> str: ...
|
||||
def display_for_value(value: Any, empty_value_display: str, boolean: bool = ...) -> str: ...
|
||||
|
||||
class NotRelationField(Exception): ...
|
||||
|
||||
def get_model_from_relation(field: Union[Field, reverse_related.ForeignObjectRel]) -> Type[Model]: ...
|
||||
def reverse_field_path(model: Type[Model], path: str) -> Tuple[Type[Model], str]: ...
|
||||
def get_fields_from_path(model: Type[Model], path: str) -> List[Union[Field, FieldCacheMixin]]: ...
|
||||
def get_fields_from_path(model: Type[Model], path: str) -> List[Field]: ...
|
||||
def construct_change_message(
|
||||
form: AdminPasswordChangeForm, formsets: None, add: bool
|
||||
) -> List[Dict[str, Dict[str, List[str]]]]: ...
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
from typing import Any, Callable, Optional
|
||||
from typing import Callable, TypeVar, overload
|
||||
|
||||
def staff_member_required(
|
||||
view_func: Optional[Callable] = ..., redirect_field_name: str = ..., login_url: str = ...
|
||||
) -> Callable: ...
|
||||
_C = TypeVar("_C", bound=Callable)
|
||||
@overload
|
||||
def staff_member_required(view_func: _C = ..., redirect_field_name: str = ..., login_url: str = ...) -> _C: ...
|
||||
@overload
|
||||
def staff_member_required(view_func: None = ..., redirect_field_name: str = ..., login_url: str = ...) -> Callable: ...
|
||||
|
||||
@@ -2,7 +2,11 @@ from collections import OrderedDict
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
from django.contrib.admin.filters import ListFilter, SimpleListFilter
|
||||
from django.contrib.admin.options import ModelAdmin, IS_POPUP_VAR as IS_POPUP_VAR, TO_FIELD_VAR as TO_FIELD_VAR
|
||||
from django.contrib.admin.options import ( # noqa: F401
|
||||
ModelAdmin,
|
||||
IS_POPUP_VAR as IS_POPUP_VAR,
|
||||
TO_FIELD_VAR as TO_FIELD_VAR,
|
||||
)
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.expressions import Combinable, CombinedExpression, OrderBy
|
||||
@@ -77,9 +81,7 @@ class ChangeList:
|
||||
paginator: Any = ...
|
||||
def get_results(self, request: WSGIRequest) -> None: ...
|
||||
def get_ordering_field(self, field_name: Union[Callable, str]) -> Optional[Union[CombinedExpression, str]]: ...
|
||||
def get_ordering(
|
||||
self, request: WSGIRequest, queryset: QuerySet
|
||||
) -> Union[List[Union[Combinable, str]], List[Union[OrderBy, str]]]: ...
|
||||
def get_ordering(self, request: WSGIRequest, queryset: QuerySet) -> List[Union[OrderBy, Combinable, str]]: ...
|
||||
def get_ordering_field_columns(self) -> OrderedDict: ...
|
||||
def get_queryset(self, request: WSGIRequest) -> QuerySet: ...
|
||||
def apply_select_related(self, qs: QuerySet) -> QuerySet: ...
|
||||
|
||||
@@ -3,46 +3,17 @@ from typing import Any, Optional, Union
|
||||
from django.db.models.fields import Field
|
||||
from django.views.generic import TemplateView
|
||||
|
||||
from .utils import get_view_name
|
||||
|
||||
MODEL_METHODS_EXCLUDE: Any
|
||||
|
||||
class BaseAdminDocsView(TemplateView):
|
||||
template_name: str = ...
|
||||
def dispatch(self, request: Any, *args: Any, **kwargs: Any): ...
|
||||
def get_context_data(self, **kwargs: Any): ...
|
||||
|
||||
class BookmarkletsView(BaseAdminDocsView):
|
||||
template_name: str = ...
|
||||
def get_context_data(self, **kwargs: Any): ...
|
||||
|
||||
class TemplateTagIndexView(BaseAdminDocsView):
|
||||
template_name: str = ...
|
||||
def get_context_data(self, **kwargs: Any): ...
|
||||
|
||||
class TemplateFilterIndexView(BaseAdminDocsView):
|
||||
template_name: str = ...
|
||||
def get_context_data(self, **kwargs: Any): ...
|
||||
|
||||
class ViewIndexView(BaseAdminDocsView):
|
||||
template_name: str = ...
|
||||
def get_context_data(self, **kwargs: Any): ...
|
||||
|
||||
class ViewDetailView(BaseAdminDocsView):
|
||||
template_name: str = ...
|
||||
def get_context_data(self, **kwargs: Any): ...
|
||||
|
||||
class ModelIndexView(BaseAdminDocsView):
|
||||
template_name: str = ...
|
||||
def get_context_data(self, **kwargs: Any): ...
|
||||
|
||||
class ModelDetailView(BaseAdminDocsView):
|
||||
template_name: str = ...
|
||||
def get_context_data(self, **kwargs: Any): ...
|
||||
|
||||
class TemplateDetailView(BaseAdminDocsView):
|
||||
template_name: str = ...
|
||||
def get_context_data(self, **kwargs: Any): ...
|
||||
class BaseAdminDocsView(TemplateView): ...
|
||||
class BookmarkletsView(BaseAdminDocsView): ...
|
||||
class TemplateTagIndexView(BaseAdminDocsView): ...
|
||||
class TemplateFilterIndexView(BaseAdminDocsView): ...
|
||||
class ViewIndexView(BaseAdminDocsView): ...
|
||||
class ViewDetailView(BaseAdminDocsView): ...
|
||||
class ModelIndexView(BaseAdminDocsView): ...
|
||||
class ModelDetailView(BaseAdminDocsView): ...
|
||||
class TemplateDetailView(BaseAdminDocsView): ...
|
||||
|
||||
def get_return_data_type(func_name: Any): ...
|
||||
def get_readable_field_data_type(field: Union[Field, str]) -> str: ...
|
||||
|
||||
@@ -1,23 +1,34 @@
|
||||
from typing import Any, Optional, Set, Union
|
||||
|
||||
from django.contrib.auth.base_user import AbstractBaseUser
|
||||
from django.contrib.auth.models import AnonymousUser, User
|
||||
from django.contrib.auth.models import AnonymousUser, User, Permission
|
||||
|
||||
from django.db.models.base import Model
|
||||
|
||||
_AnyUser = Union[Model, AnonymousUser]
|
||||
|
||||
UserModel: Any
|
||||
|
||||
class ModelBackend:
|
||||
class BaseBackend:
|
||||
def authenticate(
|
||||
self, request: Any, username: Optional[Union[int, str]] = ..., password: Optional[str] = ..., **kwargs: Any
|
||||
self, request: Any, username: Optional[str] = ..., password: Optional[str] = ..., **kwargs: Any
|
||||
) -> Optional[AbstractBaseUser]: ...
|
||||
def user_can_authenticate(self, user: Optional[AbstractBaseUser]) -> bool: ...
|
||||
def get_user_permissions(self, user_obj: AbstractBaseUser, obj: None = ...) -> Set[str]: ...
|
||||
def get_group_permissions(self, user_obj: AbstractBaseUser, obj: None = ...) -> Set[str]: ...
|
||||
def get_all_permissions(self, user_obj: AbstractBaseUser, obj: Optional[str] = ...) -> Set[str]: ...
|
||||
def has_perm(
|
||||
self, user_obj: Union[AbstractBaseUser, AnonymousUser], perm: str, obj: Optional[str] = ...
|
||||
) -> bool: ...
|
||||
def has_module_perms(self, user_obj: Union[AbstractBaseUser, AnonymousUser], app_label: str) -> bool: ...
|
||||
def get_user(self, user_id: int) -> AbstractBaseUser: ...
|
||||
def get_user(self, user_id: int) -> Optional[AbstractBaseUser]: ...
|
||||
def get_user_permissions(self, user_obj: _AnyUser, obj: Optional[Model] = ...) -> Set[str]: ...
|
||||
def get_group_permissions(self, user_obj: _AnyUser, obj: Optional[Model] = ...) -> Set[str]: ...
|
||||
def get_all_permissions(self, user_obj: _AnyUser, obj: Optional[Model] = ...) -> Set[str]: ...
|
||||
def has_perm(self, user_obj: _AnyUser, perm: str, obj: Optional[Model] = ...) -> bool: ...
|
||||
|
||||
class ModelBackend(BaseBackend):
|
||||
def has_module_perms(self, user_obj: _AnyUser, app_label: str) -> bool: ...
|
||||
def user_can_authenticate(self, user: Optional[_AnyUser]) -> bool: ...
|
||||
def with_perm(
|
||||
self,
|
||||
perm: Union[str, Permission],
|
||||
is_active: bool = ...,
|
||||
include_superusers: bool = ...,
|
||||
obj: Optional[Model] = ...,
|
||||
): ...
|
||||
|
||||
class AllowAllUsersModelBackend(ModelBackend): ...
|
||||
|
||||
|
||||
@@ -13,14 +13,11 @@ class BaseUserManager(models.Manager[_T]):
|
||||
def get_by_natural_key(self, username: Optional[str]) -> _T: ...
|
||||
|
||||
class AbstractBaseUser(models.Model):
|
||||
password: models.CharField = ...
|
||||
last_login: models.DateTimeField = ...
|
||||
is_active: models.BooleanField = ...
|
||||
REQUIRED_FIELDS: List[str] = ...
|
||||
class Meta: ...
|
||||
|
||||
password = models.CharField(max_length=128)
|
||||
last_login = models.DateTimeField(blank=True, null=True)
|
||||
def get_username(self) -> str: ...
|
||||
def clean(self) -> None: ...
|
||||
def save(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def natural_key(self) -> Tuple[str]: ...
|
||||
@property
|
||||
def is_anonymous(self) -> bool: ...
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from typing import Any, List
|
||||
from typing import Any, List, Iterable, Optional
|
||||
|
||||
from django.core.checks.messages import CheckMessage
|
||||
|
||||
def check_user_model(app_configs: None = ..., **kwargs: Any) -> List[CheckMessage]: ...
|
||||
def check_models_permissions(app_configs: None = ..., **kwargs: Any) -> List[Any]: ...
|
||||
from django.apps.config import AppConfig
|
||||
|
||||
def check_user_model(app_configs: Optional[Iterable[AppConfig]] = ..., **kwargs: Any) -> List[CheckMessage]: ...
|
||||
def check_models_permissions(app_configs: Optional[Iterable[AppConfig]] = ..., **kwargs: Any) -> List[Any]: ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from typing import Any, Callable, List, Optional, Set, Union
|
||||
from typing import Callable, List, Optional, Set, Union
|
||||
|
||||
from django.contrib.auth import REDIRECT_FIELD_NAME as REDIRECT_FIELD_NAME
|
||||
from django.contrib.auth import REDIRECT_FIELD_NAME as REDIRECT_FIELD_NAME # noqa: F401
|
||||
|
||||
def user_passes_test(
|
||||
test_func: Callable, login_url: Optional[str] = ..., redirect_field_name: str = ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Dict, Optional
|
||||
from typing import Any, Dict
|
||||
|
||||
UserModel: Any
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import getpass as getpass
|
||||
import getpass as getpass # noqa: F401
|
||||
from typing import Any
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
@@ -23,6 +23,6 @@ class PermissionRequiredMixin(AccessMixin):
|
||||
def dispatch(self, request: http.HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse: ...
|
||||
|
||||
class UserPassesTestMixin(AccessMixin):
|
||||
def test_func(self) -> None: ...
|
||||
def test_func(self) -> Optional[bool]: ...
|
||||
def get_test_func(self) -> Callable: ...
|
||||
def dispatch(self, request: http.HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse: ...
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from typing import Any, Collection, Optional, Set, Tuple, Type, TypeVar
|
||||
from typing import Any, Collection, Optional, Set, Tuple, Type, TypeVar, Union
|
||||
|
||||
from django.contrib.auth.backends import ModelBackend
|
||||
from django.contrib.auth.base_user import AbstractBaseUser as AbstractBaseUser, BaseUserManager as BaseUserManager
|
||||
from django.contrib.auth.validators import UnicodeUsernameValidator
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
@@ -8,24 +9,30 @@ from django.db.models.manager import EmptyManager
|
||||
|
||||
from django.db import models
|
||||
|
||||
_AnyUser = Union[Model, "AnonymousUser"]
|
||||
|
||||
def update_last_login(sender: Type[AbstractBaseUser], user: AbstractBaseUser, **kwargs: Any) -> None: ...
|
||||
|
||||
class PermissionManager(models.Manager):
|
||||
class PermissionManager(models.Manager["Permission"]):
|
||||
def get_by_natural_key(self, codename: str, app_label: str, model: str) -> Permission: ...
|
||||
|
||||
class Permission(models.Model):
|
||||
content_type_id: int
|
||||
name: models.CharField = ...
|
||||
content_type: models.ForeignKey = models.ForeignKey(ContentType, on_delete=models.CASCADE)
|
||||
codename: models.CharField = ...
|
||||
objects: PermissionManager
|
||||
|
||||
name = models.CharField(max_length=255)
|
||||
content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
|
||||
codename = models.CharField(max_length=100)
|
||||
def natural_key(self) -> Tuple[str, str, str]: ...
|
||||
|
||||
class GroupManager(models.Manager):
|
||||
class GroupManager(models.Manager["Group"]):
|
||||
def get_by_natural_key(self, name: str) -> Group: ...
|
||||
|
||||
class Group(models.Model):
|
||||
name: models.CharField = ...
|
||||
permissions: models.ManyToManyField = models.ManyToManyField(Permission)
|
||||
objects: GroupManager
|
||||
|
||||
name = models.CharField(max_length=150)
|
||||
permissions = models.ManyToManyField(Permission)
|
||||
def natural_key(self): ...
|
||||
|
||||
_T = TypeVar("_T", bound=Model)
|
||||
@@ -37,28 +44,39 @@ class UserManager(BaseUserManager[_T]):
|
||||
def create_superuser(
|
||||
self, username: str, email: Optional[str], password: Optional[str], **extra_fields: Any
|
||||
) -> _T: ...
|
||||
def with_perm(
|
||||
self,
|
||||
perm: Union[str, Permission],
|
||||
is_active: bool = ...,
|
||||
include_superusers: bool = ...,
|
||||
backend: Optional[Union[Type[ModelBackend], str]] = ...,
|
||||
obj: Optional[Model] = ...,
|
||||
): ...
|
||||
|
||||
class PermissionsMixin(models.Model):
|
||||
is_superuser: models.BooleanField = ...
|
||||
groups: models.ManyToManyField = models.ManyToManyField(Group)
|
||||
user_permissions: models.ManyToManyField = models.ManyToManyField(Permission)
|
||||
def get_group_permissions(self, obj: None = ...) -> Set[str]: ...
|
||||
def get_all_permissions(self, obj: Optional[str] = ...) -> Set[str]: ...
|
||||
def has_perm(self, perm: str, obj: Optional[str] = ...) -> bool: ...
|
||||
def has_perms(self, perm_list: Collection[str], obj: None = ...) -> bool: ...
|
||||
is_superuser = models.BooleanField()
|
||||
groups = models.ManyToManyField(Group)
|
||||
user_permissions = models.ManyToManyField(Permission)
|
||||
def get_user_permissions(self, obj: Optional[_AnyUser] = ...) -> Set[str]: ...
|
||||
def get_group_permissions(self, obj: Optional[_AnyUser] = ...) -> Set[str]: ...
|
||||
def get_all_permissions(self, obj: Optional[_AnyUser] = ...) -> Set[str]: ...
|
||||
def has_perm(self, perm: str, obj: Optional[_AnyUser] = ...) -> bool: ...
|
||||
def has_perms(self, perm_list: Collection[str], obj: Optional[_AnyUser] = ...) -> bool: ...
|
||||
def has_module_perms(self, app_label: str) -> bool: ...
|
||||
|
||||
class AbstractUser(AbstractBaseUser, PermissionsMixin): # type: ignore
|
||||
username_validator: UnicodeUsernameValidator = ...
|
||||
username: models.CharField = ...
|
||||
first_name: models.CharField = ...
|
||||
last_name: models.CharField = ...
|
||||
email: models.EmailField = ...
|
||||
is_staff: models.BooleanField = ...
|
||||
date_joined: models.DateTimeField = ...
|
||||
|
||||
username = models.CharField(max_length=150)
|
||||
first_name = models.CharField(max_length=30, blank=True)
|
||||
last_name = models.CharField(max_length=150, blank=True)
|
||||
email = models.EmailField(blank=True)
|
||||
is_staff = models.BooleanField()
|
||||
is_active = models.BooleanField()
|
||||
date_joined = models.DateTimeField()
|
||||
|
||||
EMAIL_FIELD: str = ...
|
||||
USERNAME_FIELD: str = ...
|
||||
def clean(self) -> None: ...
|
||||
def get_full_name(self) -> str: ...
|
||||
def get_short_name(self) -> str: ...
|
||||
def email_user(self, subject: str, message: str, from_email: str = ..., **kwargs: Any) -> None: ...
|
||||
@@ -80,10 +98,11 @@ class AnonymousUser:
|
||||
def groups(self) -> EmptyManager: ...
|
||||
@property
|
||||
def user_permissions(self) -> EmptyManager: ...
|
||||
def get_group_permissions(self, obj: None = ...) -> Set[Any]: ...
|
||||
def get_all_permissions(self, obj: Any = ...) -> Set[str]: ...
|
||||
def has_perm(self, perm: str, obj: None = ...) -> bool: ...
|
||||
def has_perms(self, perm_list: Collection[str], obj: None = ...) -> bool: ...
|
||||
def get_user_permissions(self, obj: Optional[_AnyUser] = ...) -> Set[str]: ...
|
||||
def get_group_permissions(self, obj: Optional[_AnyUser] = ...) -> Set[Any]: ...
|
||||
def get_all_permissions(self, obj: Optional[_AnyUser] = ...) -> Set[str]: ...
|
||||
def has_perm(self, perm: str, obj: Optional[_AnyUser] = ...) -> bool: ...
|
||||
def has_perms(self, perm_list: Collection[str], obj: Optional[_AnyUser] = ...) -> bool: ...
|
||||
def has_module_perms(self, module: str) -> bool: ...
|
||||
@property
|
||||
def is_anonymous(self) -> bool: ...
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from pathlib import Path, PosixPath
|
||||
from typing import Any, List, Mapping, Optional, Protocol, Sequence, Set, Union
|
||||
|
||||
from django.contrib.auth.base_user import AbstractBaseUser
|
||||
from django.db.models.base import Model
|
||||
|
||||
_UserModel = Model
|
||||
|
||||
@@ -55,6 +55,7 @@ class PasswordResetDoneView(PasswordContextMixin, TemplateView):
|
||||
class PasswordResetConfirmView(PasswordContextMixin, FormView):
|
||||
post_reset_login: bool = ...
|
||||
post_reset_login_backend: Any = ...
|
||||
reset_url_token: str = ...
|
||||
title: Any = ...
|
||||
token_generator: Any = ...
|
||||
validlink: bool = ...
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
from typing import Any, List, Optional
|
||||
from typing import Any, List, Iterable, Optional
|
||||
|
||||
def check_generic_foreign_keys(app_configs: None = ..., **kwargs: Any) -> List[Any]: ...
|
||||
def check_model_name_lengths(app_configs: None = ..., **kwargs: Any) -> List[Any]: ...
|
||||
from django.apps.config import AppConfig
|
||||
|
||||
def check_generic_foreign_keys(app_configs: Optional[Iterable[AppConfig]] = ..., **kwargs: Any) -> List[Any]: ...
|
||||
def check_model_name_lengths(app_configs: Optional[Iterable[AppConfig]] = ..., **kwargs: Any) -> List[Any]: ...
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union, Generic
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.core.checks.messages import Error
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.expressions import Combinable
|
||||
from django.db.models.fields.mixins import FieldCacheMixin
|
||||
from django.db.models.fields.related import ForeignObject
|
||||
from django.db.models.fields.related_descriptors import ReverseManyToOneDescriptor
|
||||
from django.db.models.fields.reverse_related import ForeignObjectRel
|
||||
|
||||
from django.db.models.expressions import Combinable
|
||||
from django.db.models.fields import Field, PositiveIntegerField
|
||||
from django.db.models.fields.mixins import FieldCacheMixin
|
||||
from django.db.models.query import QuerySet
|
||||
from django.db.models.query_utils import FilteredRelation, PathInfo
|
||||
from django.db.models.sql.where import WhereNode
|
||||
|
||||
from django.db.models.fields import Field, PositiveIntegerField
|
||||
|
||||
class GenericForeignKey(FieldCacheMixin):
|
||||
# django-stubs implementation only fields
|
||||
_pyi_private_set_type: Union[Any, Combinable]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional, Union
|
||||
from typing import Union
|
||||
|
||||
from django.http.request import HttpRequest
|
||||
from django.http.response import HttpResponseRedirect
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.contrib.flatpages.models import FlatPage
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.response import HttpResponse
|
||||
|
||||
0
django-stubs/contrib/gis/__init__.pyi
Normal file
0
django-stubs/contrib/gis/__init__.pyi
Normal file
0
django-stubs/contrib/gis/db/__init__.pyi
Normal file
0
django-stubs/contrib/gis/db/__init__.pyi
Normal file
13
django-stubs/contrib/gis/db/models/__init__.pyi
Normal file
13
django-stubs/contrib/gis/db/models/__init__.pyi
Normal file
@@ -0,0 +1,13 @@
|
||||
from django.db.models import *
|
||||
|
||||
from .fields import (
|
||||
GeometryField as GeometryField,
|
||||
LineStringField as LineStringField,
|
||||
MultiLineStringField as MultiLineStringField,
|
||||
MultiPointField as MultiPointField,
|
||||
MultiPolygonField as MultiPolygonField,
|
||||
PointField as PointField,
|
||||
PolygonField as PolygonField,
|
||||
GeometryCollectionField as GeometryCollectionField,
|
||||
RasterField as RasterField,
|
||||
)
|
||||
91
django-stubs/contrib/gis/db/models/fields.pyi
Normal file
91
django-stubs/contrib/gis/db/models/fields.pyi
Normal file
@@ -0,0 +1,91 @@
|
||||
from typing import Any, Iterable, NamedTuple, Optional, TypeVar, Union, Tuple
|
||||
|
||||
from django.db.models.fields import Field, _ErrorMessagesToOverride, _FieldChoices, _ValidatorCallable
|
||||
|
||||
_Connection = Any
|
||||
|
||||
# __set__ value type
|
||||
_ST = TypeVar("_ST")
|
||||
# __get__ return type
|
||||
_GT = TypeVar("_GT")
|
||||
|
||||
class SRIDCacheEntry(NamedTuple):
|
||||
units: Any
|
||||
units_name: str
|
||||
geodetic: bool
|
||||
spheroid: str
|
||||
|
||||
def get_srid_info(srid: int, connection: _Connection) -> SRIDCacheEntry: ...
|
||||
|
||||
class BaseSpatialField(Field[_ST, _GT]):
|
||||
def __init__(
|
||||
self,
|
||||
verbose_name: Optional[Union[str, bytes]] = ...,
|
||||
srid: int = ...,
|
||||
spatial_index: bool = ...,
|
||||
name: Optional[str] = ...,
|
||||
primary_key: bool = ...,
|
||||
max_length: Optional[int] = ...,
|
||||
unique: bool = ...,
|
||||
blank: bool = ...,
|
||||
null: bool = ...,
|
||||
db_index: bool = ...,
|
||||
default: Any = ...,
|
||||
editable: bool = ...,
|
||||
auto_created: bool = ...,
|
||||
serialize: bool = ...,
|
||||
unique_for_date: Optional[str] = ...,
|
||||
unique_for_month: Optional[str] = ...,
|
||||
unique_for_year: Optional[str] = ...,
|
||||
choices: Optional[_FieldChoices] = ...,
|
||||
help_text: str = ...,
|
||||
db_column: Optional[str] = ...,
|
||||
db_tablespace: Optional[str] = ...,
|
||||
validators: Iterable[_ValidatorCallable] = ...,
|
||||
error_messages: Optional[_ErrorMessagesToOverride] = ...,
|
||||
): ...
|
||||
def spheroid(self, connection: _Connection) -> str: ...
|
||||
def units(self, connection: _Connection) -> Any: ...
|
||||
def units_name(self, connection: _Connection) -> str: ...
|
||||
def geodetic(self, connection: _Connection) -> bool: ...
|
||||
|
||||
class GeometryField(BaseSpatialField):
|
||||
def __init__(
|
||||
self,
|
||||
verbose_name: Optional[Union[str, bytes]] = ...,
|
||||
dim: int = ...,
|
||||
geography: bool = ...,
|
||||
extent: Tuple[float, float, float, float] = ...,
|
||||
tolerance: float = ...,
|
||||
srid: int = ...,
|
||||
spatial_index: bool = ...,
|
||||
name: Optional[str] = ...,
|
||||
primary_key: bool = ...,
|
||||
max_length: Optional[int] = ...,
|
||||
unique: bool = ...,
|
||||
blank: bool = ...,
|
||||
null: bool = ...,
|
||||
db_index: bool = ...,
|
||||
default: Any = ...,
|
||||
editable: bool = ...,
|
||||
auto_created: bool = ...,
|
||||
serialize: bool = ...,
|
||||
unique_for_date: Optional[str] = ...,
|
||||
unique_for_month: Optional[str] = ...,
|
||||
unique_for_year: Optional[str] = ...,
|
||||
choices: Optional[_FieldChoices] = ...,
|
||||
help_text: str = ...,
|
||||
db_column: Optional[str] = ...,
|
||||
db_tablespace: Optional[str] = ...,
|
||||
validators: Iterable[_ValidatorCallable] = ...,
|
||||
error_messages: Optional[_ErrorMessagesToOverride] = ...,
|
||||
): ...
|
||||
|
||||
class PointField(GeometryField): ...
|
||||
class LineStringField(GeometryField): ...
|
||||
class PolygonField(GeometryField): ...
|
||||
class MultiPointField(GeometryField): ...
|
||||
class MultiLineStringField(GeometryField): ...
|
||||
class MultiPolygonField(GeometryField): ...
|
||||
class GeometryCollectionField(GeometryField): ...
|
||||
class RasterField(BaseSpatialField): ...
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
from typing import Any, Dict, List, Union
|
||||
|
||||
from django.contrib.messages.storage.base import BaseStorage
|
||||
from django.http.request import HttpRequest
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, List, Optional, Union
|
||||
from typing import Any, List, Optional
|
||||
|
||||
from django.http.request import HttpRequest
|
||||
from django.http.response import HttpResponseBase
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
from typing import Dict, Optional
|
||||
from typing import Dict
|
||||
|
||||
def get_level_tags() -> Dict[int, str]: ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Dict, Optional
|
||||
from typing import Dict
|
||||
|
||||
from django.forms.forms import BaseForm
|
||||
from django.http.response import HttpResponse
|
||||
|
||||
24
django-stubs/contrib/postgres/aggregates/__init__.pyi
Normal file
24
django-stubs/contrib/postgres/aggregates/__init__.pyi
Normal file
@@ -0,0 +1,24 @@
|
||||
from .general import (
|
||||
ArrayAgg as ArrayAgg,
|
||||
BitAnd as BitAnd,
|
||||
BitOr as BitOr,
|
||||
BoolAnd as BoolAnd,
|
||||
BoolOr as BoolOr,
|
||||
JSONBAgg as JSONBAgg,
|
||||
StringAgg as StringAgg,
|
||||
)
|
||||
|
||||
from .statistics import (
|
||||
Corr as Corr,
|
||||
CovarPop as CovarPop,
|
||||
RegrAvgX as RegrAvgX,
|
||||
RegrAvgY as RegrAvgY,
|
||||
RegrCount as RegrCount,
|
||||
RegrIntercept as RegrIntercept,
|
||||
RegrR2 as RegrR2,
|
||||
RegrSlope as RegrSlope,
|
||||
RegrSXX as RegrSXX,
|
||||
RegrSXY as RegrSXY,
|
||||
RegrSYY as RegrSYY,
|
||||
StatAggregate as StatAggregate,
|
||||
)
|
||||
11
django-stubs/contrib/postgres/aggregates/general.pyi
Normal file
11
django-stubs/contrib/postgres/aggregates/general.pyi
Normal file
@@ -0,0 +1,11 @@
|
||||
from django.db.models.aggregates import Aggregate
|
||||
|
||||
from .mixins import OrderableAggMixin
|
||||
|
||||
class ArrayAgg(OrderableAggMixin, Aggregate): ...
|
||||
class BitAnd(Aggregate): ...
|
||||
class BitOr(Aggregate): ...
|
||||
class BoolAnd(Aggregate): ...
|
||||
class BoolOr(Aggregate): ...
|
||||
class JSONBAgg(Aggregate): ...
|
||||
class StringAgg(OrderableAggMixin, Aggregate): ...
|
||||
1
django-stubs/contrib/postgres/aggregates/mixins.pyi
Normal file
1
django-stubs/contrib/postgres/aggregates/mixins.pyi
Normal file
@@ -0,0 +1 @@
|
||||
class OrderableAggMixin: ...
|
||||
14
django-stubs/contrib/postgres/aggregates/statistics.pyi
Normal file
14
django-stubs/contrib/postgres/aggregates/statistics.pyi
Normal file
@@ -0,0 +1,14 @@
|
||||
from django.db.models.aggregates import Aggregate
|
||||
|
||||
class StatAggregate(Aggregate): ...
|
||||
class Corr(StatAggregate): ...
|
||||
class CovarPop(StatAggregate): ...
|
||||
class RegrAvgX(StatAggregate): ...
|
||||
class RegrAvgY(StatAggregate): ...
|
||||
class RegrCount(StatAggregate): ...
|
||||
class RegrIntercept(StatAggregate): ...
|
||||
class RegrR2(StatAggregate): ...
|
||||
class RegrSlope(StatAggregate): ...
|
||||
class RegrSXX(StatAggregate): ...
|
||||
class RegrSXY(StatAggregate): ...
|
||||
class RegrSYY(StatAggregate): ...
|
||||
18
django-stubs/contrib/postgres/constraints.pyi
Normal file
18
django-stubs/contrib/postgres/constraints.pyi
Normal file
@@ -0,0 +1,18 @@
|
||||
from typing import Optional, Sequence, Tuple, Union
|
||||
|
||||
from django.db.models.constraints import BaseConstraint
|
||||
from django.db.models.expressions import Combinable
|
||||
from django.db.models.query_utils import Q
|
||||
|
||||
class ExclusionConstraint(BaseConstraint):
|
||||
expressions: Sequence[Tuple[Union[str, Combinable], str]]
|
||||
index_type: str
|
||||
condition: Optional[Q]
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
name: str,
|
||||
expressions: Sequence[Tuple[Union[str, Combinable], str]],
|
||||
condition: Optional[Q] = ...,
|
||||
index_type: Optional[str] = ...,
|
||||
): ...
|
||||
@@ -8,6 +8,8 @@ from .ranges import (
|
||||
FloatRangeField as FloatRangeField,
|
||||
DateRangeField as DateRangeField,
|
||||
DateTimeRangeField as DateTimeRangeField,
|
||||
RangeOperators as RangeOperators,
|
||||
RangeBoundary as RangeBoundary,
|
||||
)
|
||||
from .hstore import HStoreField as HStoreField
|
||||
from .citext import (
|
||||
|
||||
@@ -29,3 +29,20 @@ class DateTimeRangeField(RangeField):
|
||||
|
||||
class DateRangeField(RangeField):
|
||||
def __get__(self, instance, owner) -> DateRange: ...
|
||||
|
||||
class RangeOperators:
|
||||
EQUAL: str
|
||||
NOT_EQUAL: str
|
||||
CONTAINS: str
|
||||
CONTAINED_BY: str
|
||||
OVERLAPS: str
|
||||
FULLY_LT: str
|
||||
FULLY_GT: str
|
||||
NOT_LT: str
|
||||
NOT_GT: str
|
||||
ADJACENT_TO: str
|
||||
|
||||
class RangeBoundary(models.Expression):
|
||||
lower: str
|
||||
upper: str
|
||||
def __init__(self, inclusive_lower: bool = ..., inclusive_upper: bool = ...): ...
|
||||
|
||||
@@ -1,29 +1,82 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Optional, Sequence
|
||||
|
||||
from django.db.models.query_utils import Q
|
||||
|
||||
from django.db.models import Index
|
||||
|
||||
class PostgresIndex(Index):
|
||||
@property
|
||||
def max_name_length(self) -> int: ...
|
||||
class PostgresIndex(Index): ...
|
||||
|
||||
class BrinIndex(PostgresIndex):
|
||||
def __init__(
|
||||
self, *, autosummarize: Optional[bool] = ..., pages_per_range: Optional[int] = ..., **kwargs: Any
|
||||
self,
|
||||
*,
|
||||
autosummarize: Optional[bool] = ...,
|
||||
pages_per_range: Optional[int] = ...,
|
||||
fields: Sequence[str] = ...,
|
||||
name: Optional[str] = ...,
|
||||
db_tablespace: Optional[str] = ...,
|
||||
opclasses: Sequence[str] = ...,
|
||||
condition: Optional[Q] = ...
|
||||
) -> None: ...
|
||||
|
||||
class BTreeIndex(PostgresIndex):
|
||||
def __init__(self, *, fillfactor: Optional[int] = ..., **kwargs: Any): ...
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
fillfactor: Optional[int] = ...,
|
||||
fields: Sequence[str] = ...,
|
||||
name: Optional[str] = ...,
|
||||
db_tablespace: Optional[str] = ...,
|
||||
opclasses: Sequence[str] = ...,
|
||||
condition: Optional[Q] = ...
|
||||
) -> None: ...
|
||||
|
||||
class GinIndex(PostgresIndex):
|
||||
def __init__(
|
||||
self, *, fastupdate: Optional[bool] = ..., gin_pending_list_limit: Optional[int] = ..., **kwargs: Any
|
||||
self,
|
||||
*,
|
||||
fastupdate: Optional[bool] = ...,
|
||||
gin_pending_list_limit: Optional[int] = ...,
|
||||
fields: Sequence[str] = ...,
|
||||
name: Optional[str] = ...,
|
||||
db_tablespace: Optional[str] = ...,
|
||||
opclasses: Sequence[str] = ...,
|
||||
condition: Optional[Q] = ...
|
||||
) -> None: ...
|
||||
|
||||
class GistIndex(PostgresIndex):
|
||||
def __init__(self, *, buffering: Optional[bool] = ..., fillfactor: Optional[int] = ..., **kwargs: Any) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
buffering: Optional[bool] = ...,
|
||||
fillfactor: Optional[int] = ...,
|
||||
fields: Sequence[str] = ...,
|
||||
name: Optional[str] = ...,
|
||||
db_tablespace: Optional[str] = ...,
|
||||
opclasses: Sequence[str] = ...,
|
||||
condition: Optional[Q] = ...
|
||||
) -> None: ...
|
||||
|
||||
class HashIndex(PostgresIndex):
|
||||
def __init__(self, *, fillfactor: Optional[int] = ..., **kwargs: Any) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
fillfactor: Optional[int] = ...,
|
||||
fields: Sequence[str] = ...,
|
||||
name: Optional[str] = ...,
|
||||
db_tablespace: Optional[str] = ...,
|
||||
opclasses: Sequence[str] = ...,
|
||||
condition: Optional[Q] = ...
|
||||
) -> None: ...
|
||||
|
||||
class SpGistIndex(PostgresIndex):
|
||||
def __init__(self, *, fillfactor: Optional[int] = ..., **kwargs: Any) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
fillfactor: Optional[int] = ...,
|
||||
fields: Sequence[str] = ...,
|
||||
name: Optional[str] = ...,
|
||||
db_tablespace: Optional[str] = ...,
|
||||
opclasses: Sequence[str] = ...,
|
||||
condition: Optional[Q] = ...
|
||||
) -> None: ...
|
||||
|
||||
18
django-stubs/contrib/postgres/lookups.pyi
Normal file
18
django-stubs/contrib/postgres/lookups.pyi
Normal file
@@ -0,0 +1,18 @@
|
||||
from django.db.models.lookups import Exact
|
||||
|
||||
from django.db.models import Lookup, Transform
|
||||
from .search import SearchVectorExact
|
||||
|
||||
class PostgresSimpleLookup(Lookup):
|
||||
operator: str
|
||||
|
||||
class DataContains(PostgresSimpleLookup): ...
|
||||
class ContainedBy(PostgresSimpleLookup): ...
|
||||
class Overlap(PostgresSimpleLookup): ...
|
||||
class HasKey(PostgresSimpleLookup): ...
|
||||
class HasKeys(PostgresSimpleLookup): ...
|
||||
class HasAnyKeys(HasKeys): ...
|
||||
class Unaccent(Transform): ...
|
||||
class SearchLookup(SearchVectorExact): ...
|
||||
class TrigramSimilar(PostgresSimpleLookup): ...
|
||||
class JSONExact(Exact): ...
|
||||
@@ -1,10 +1,12 @@
|
||||
from typing import Any, Dict, Optional, TypeVar, Union
|
||||
|
||||
from django.db.models.expressions import Combinable, CombinedExpression, Func, Value
|
||||
from django.db.models.expressions import Combinable, CombinedExpression, Func, Value, _OutputField
|
||||
from django.db.models.lookups import Lookup
|
||||
|
||||
from django.db.models import Field
|
||||
|
||||
_Expression = Union[str, Combinable, "SearchQueryCombinable"]
|
||||
|
||||
class SearchVectorExact(Lookup): ...
|
||||
class SearchVectorField(Field): ...
|
||||
class SearchQueryField(Field): ...
|
||||
@@ -14,10 +16,12 @@ class SearchVectorCombinable:
|
||||
|
||||
class SearchVector(SearchVectorCombinable, Func):
|
||||
config: Optional[Any] = ...
|
||||
def __init__(self, *expressions: Union[str, Combinable], **extra: Any): ...
|
||||
def __init__(self, *expressions: _Expression, **extra: Any): ...
|
||||
|
||||
class CombinedSearchVector(SearchVectorCombinable, CombinedExpression):
|
||||
def __init__(self, lhs, connector, rhs, config, output_field: Optional[Field, str] = ...): ...
|
||||
def __init__(
|
||||
self, lhs, connector, rhs, config: Optional[_Expression] = ..., output_field: Optional[_OutputField] = ...
|
||||
): ...
|
||||
|
||||
_T = TypeVar("_T", bound="SearchQueryCombinable")
|
||||
|
||||
@@ -29,19 +33,31 @@ class SearchQueryCombinable:
|
||||
def __and__(self: _T, other: SearchQueryCombinable) -> _T: ...
|
||||
def __rand__(self: _T, other: SearchQueryCombinable) -> _T: ...
|
||||
|
||||
class SearchQuery(SearchQueryCombinable, Value):
|
||||
SEARCH_TYPES: Dict[str, str] = {"plain": "plainto_tsquery", "phrase": "phraseto_tsquery", "raw": "to_tsquery"}
|
||||
def __init__(self, value, output_field=..., *, config=..., invert=False, search_type="plain"): ...
|
||||
class SearchQuery(SearchQueryCombinable, Value): # type: ignore
|
||||
SEARCH_TYPES: Dict[str, str] = ...
|
||||
def __init__(
|
||||
self,
|
||||
value: str,
|
||||
output_field: Optional[_OutputField] = ...,
|
||||
*,
|
||||
config: Optional[_Expression] = ...,
|
||||
invert: bool = ...,
|
||||
search_type: str = ...
|
||||
): ...
|
||||
def __invert__(self: _T) -> _T: ...
|
||||
|
||||
class CombinedSearchQuery(SearchQueryCombinable, CombinedExpression):
|
||||
def __init__(self, lhs, connector, rhs, config, output_field=...) -> None: ...
|
||||
class CombinedSearchQuery(SearchQueryCombinable, CombinedExpression): # type: ignore
|
||||
def __init__(
|
||||
self, lhs, connector, rhs, config: Optional[_Expression] = ..., output_field: Optional[_OutputField] = ...
|
||||
) -> None: ...
|
||||
|
||||
class SearchRank(Func):
|
||||
def __init__(self, vector, query, **extra: Any) -> None: ...
|
||||
def __init__(
|
||||
self, vector: Union[SearchVector, _Expression], query: Union[SearchQuery, _Expression], **extra: Any
|
||||
) -> None: ...
|
||||
|
||||
class TrigramBase(Func):
|
||||
def __init__(self, expression, string, **extra: Any) -> None: ...
|
||||
def __init__(self, expression: _Expression, string, **extra: Any) -> None: ...
|
||||
|
||||
class TrigramSimilarity(TrigramBase): ...
|
||||
class TrigramDistance(TrigramBase): ...
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
from typing import Any
|
||||
|
||||
from django.apps.config import AppConfig
|
||||
from django.apps.registry import Apps
|
||||
from django.contrib.sites.apps import SitesConfig
|
||||
|
||||
def create_default_site(
|
||||
app_config: SitesConfig,
|
||||
app_config: AppConfig,
|
||||
verbosity: int = ...,
|
||||
interactive: bool = ...,
|
||||
using: str = ...,
|
||||
|
||||
@@ -6,15 +6,16 @@ from django.db import models
|
||||
|
||||
SITE_CACHE: Any
|
||||
|
||||
class SiteManager(models.Manager):
|
||||
class SiteManager(models.Manager["Site"]):
|
||||
def get_current(self, request: Optional[HttpRequest] = ...) -> Site: ...
|
||||
def clear_cache(self) -> None: ...
|
||||
def get_by_natural_key(self, domain: str) -> Site: ...
|
||||
|
||||
class Site(models.Model):
|
||||
domain: models.CharField = ...
|
||||
name: models.CharField = ...
|
||||
objects: SiteManager = ...
|
||||
objects: SiteManager
|
||||
|
||||
domain = models.CharField(max_length=100)
|
||||
name = models.CharField(max_length=50)
|
||||
def natural_key(self) -> Tuple[str]: ...
|
||||
|
||||
def clear_site_cache(sender: Type[Site], **kwargs: Any) -> None: ...
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
from typing import Any, List, Optional
|
||||
from typing import Any, List, Iterable, Optional
|
||||
|
||||
from django.core.checks.messages import Error
|
||||
|
||||
def check_finders(app_configs: None = ..., **kwargs: Any) -> List[Error]: ...
|
||||
from django.apps.config import AppConfig
|
||||
|
||||
def check_finders(app_configs: Optional[Iterable[AppConfig]] = ..., **kwargs: Any) -> List[Error]: ...
|
||||
|
||||
@@ -37,7 +37,7 @@ def get_finders() -> Iterator[BaseFinder]: ...
|
||||
def get_finder(import_path: Literal["django.contrib.staticfiles.finders.FileSystemFinder"]) -> FileSystemFinder: ...
|
||||
@overload
|
||||
def get_finder(
|
||||
import_path: Literal["django.contrib.staticfiles.finders.AppDirectoriesFinder"]
|
||||
import_path: Literal["django.contrib.staticfiles.finders.AppDirectoriesFinder"],
|
||||
) -> AppDirectoriesFinder: ...
|
||||
@overload
|
||||
def get_finder(import_path: str) -> BaseFinder: ...
|
||||
|
||||
@@ -4,7 +4,6 @@ from typing import Any, Callable, Iterator, Optional, Tuple
|
||||
from django.core.files.base import File
|
||||
from django.core.files.storage import FileSystemStorage
|
||||
from django.utils.functional import LazyObject
|
||||
from django.utils.safestring import SafeText
|
||||
|
||||
class StaticFilesStorage(FileSystemStorage):
|
||||
base_location: Any = ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
from django.template.base import Parser, Token
|
||||
from django.templatetags.static import StaticNode
|
||||
|
||||
3
django-stubs/contrib/staticfiles/testing.pyi
Normal file
3
django-stubs/contrib/staticfiles/testing.pyi
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.test import LiveServerTestCase
|
||||
|
||||
class StaticLiveServerTestCase(LiveServerTestCase): ...
|
||||
@@ -1,5 +1,5 @@
|
||||
from collections import OrderedDict
|
||||
from typing import Any, Iterator, List, Optional, Tuple, Union
|
||||
from typing import Iterator, List, Optional, Tuple, Union
|
||||
|
||||
from django.core.files.storage import FileSystemStorage
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.response import FileResponse
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Dict, List, Optional
|
||||
from typing import Any, Dict, List
|
||||
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
from typing import Any, List, Optional
|
||||
from typing import Any, List, Iterable, Optional
|
||||
|
||||
from django.core.checks.messages import Error
|
||||
|
||||
from django.apps.config import AppConfig
|
||||
|
||||
E001: Any
|
||||
|
||||
def check_default_cache_is_configured(app_configs: None, **kwargs: Any) -> List[Error]: ...
|
||||
def check_default_cache_is_configured(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Error]: ...
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
from typing import Any, List, Optional
|
||||
from typing import Any, List
|
||||
|
||||
def check_database_backends(*args: Any, **kwargs: Any) -> List[Any]: ...
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from typing import Any, List
|
||||
from typing import Any, List, Iterable, Optional
|
||||
|
||||
from django.core.checks.messages import Warning
|
||||
|
||||
def check_all_models(app_configs: None = ..., **kwargs: Any) -> List[Warning]: ...
|
||||
def check_lazy_references(app_configs: None = ..., **kwargs: Any) -> List[Any]: ...
|
||||
from django.apps.config import AppConfig
|
||||
|
||||
def check_all_models(app_configs: Optional[Iterable[AppConfig]] = ..., **kwargs: Any) -> List[Warning]: ...
|
||||
def check_lazy_references(app_configs: Optional[Iterable[AppConfig]] = ..., **kwargs: Any) -> List[Any]: ...
|
||||
|
||||
@@ -12,6 +12,7 @@ class Tags:
|
||||
security: str = ...
|
||||
signals: str = ...
|
||||
templates: str = ...
|
||||
translation: str = ...
|
||||
urls: str = ...
|
||||
|
||||
class CheckRegistry:
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
from typing import Any, List, Optional
|
||||
from typing import Any, List, Iterable, Optional
|
||||
|
||||
from django.core.checks.messages import Warning
|
||||
|
||||
from django.apps.config import AppConfig
|
||||
|
||||
SECRET_KEY_MIN_LENGTH: int
|
||||
SECRET_KEY_MIN_UNIQUE_CHARACTERS: int
|
||||
W001: Any
|
||||
@@ -17,15 +19,15 @@ W019: Any
|
||||
W020: Any
|
||||
W021: Any
|
||||
|
||||
def check_security_middleware(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
||||
def check_xframe_options_middleware(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
||||
def check_sts(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
||||
def check_sts_include_subdomains(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
||||
def check_sts_preload(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
||||
def check_content_type_nosniff(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
||||
def check_xss_filter(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
||||
def check_ssl_redirect(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
||||
def check_secret_key(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
||||
def check_debug(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
||||
def check_xframe_deny(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
||||
def check_allowed_hosts(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
||||
def check_security_middleware(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||
def check_xframe_options_middleware(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||
def check_sts(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||
def check_sts_include_subdomains(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||
def check_sts_preload(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||
def check_content_type_nosniff(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||
def check_xss_filter(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||
def check_ssl_redirect(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||
def check_secret_key(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||
def check_debug(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||
def check_xframe_deny(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||
def check_allowed_hosts(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
from typing import Any, List, Optional
|
||||
from typing import Any, List, Iterable, Optional
|
||||
|
||||
from django.core.checks.messages import Warning
|
||||
|
||||
from django.apps.config import AppConfig
|
||||
|
||||
W003: Any
|
||||
W016: Any
|
||||
|
||||
def check_csrf_middleware(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
||||
def check_csrf_cookie_secure(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
||||
def check_csrf_middleware(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||
def check_csrf_cookie_secure(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
from typing import Any, List, Optional
|
||||
from typing import Any, List, Iterable, Optional
|
||||
|
||||
from django.core.checks.messages import Warning
|
||||
|
||||
from django.apps.config import AppConfig
|
||||
|
||||
def add_session_cookie_message(message: Any): ...
|
||||
|
||||
W010: Any
|
||||
@@ -14,5 +16,5 @@ W013: Any
|
||||
W014: Any
|
||||
W015: Any
|
||||
|
||||
def check_session_cookie_secure(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
||||
def check_session_cookie_httponly(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
||||
def check_session_cookie_secure(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||
def check_session_cookie_httponly(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
from typing import Any, List, Optional
|
||||
from typing import Any, List, Iterable, Optional
|
||||
|
||||
from django.core.checks.messages import Error
|
||||
|
||||
from django.apps.config import AppConfig
|
||||
|
||||
E001: Any
|
||||
E002: Any
|
||||
|
||||
def check_setting_app_dirs_loaders(app_configs: None, **kwargs: Any) -> List[Error]: ...
|
||||
def check_string_if_invalid_is_string(app_configs: None, **kwargs: Any) -> List[Error]: ...
|
||||
def check_setting_app_dirs_loaders(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Error]: ...
|
||||
def check_string_if_invalid_is_string(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Error]: ...
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
from typing import Any, Callable, List, Optional, Tuple, Union
|
||||
from typing import Any, Callable, List, Tuple, Union, Iterable, Optional
|
||||
|
||||
from django.core.checks.messages import CheckMessage, Error, Warning
|
||||
from django.urls.resolvers import URLPattern, URLResolver
|
||||
|
||||
def check_url_config(app_configs: None, **kwargs: Any) -> List[CheckMessage]: ...
|
||||
from django.apps.config import AppConfig
|
||||
|
||||
def check_url_config(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[CheckMessage]: ...
|
||||
def check_resolver(resolver: Union[Tuple[str, Callable], URLPattern, URLResolver]) -> List[CheckMessage]: ...
|
||||
def check_url_namespaces_unique(app_configs: None, **kwargs: Any) -> List[Warning]: ...
|
||||
def check_url_namespaces_unique(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Warning]: ...
|
||||
def get_warning_for_invalid_pattern(pattern: Any) -> List[Error]: ...
|
||||
def check_url_settings(app_configs: None, **kwargs: Any) -> List[Error]: ...
|
||||
def check_url_settings(app_configs: Optional[Iterable[AppConfig]], **kwargs: Any) -> List[Error]: ...
|
||||
def E006(name: str) -> Error: ...
|
||||
|
||||
@@ -14,6 +14,7 @@ class File(FileProxyMixin, IO[Any]):
|
||||
def __init__(self, file: Any, name: Optional[str] = ...) -> None: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
def __len__(self) -> int: ...
|
||||
@property
|
||||
def size(self) -> int: ...
|
||||
def chunks(self, chunk_size: Optional[int] = ...) -> Iterator[bytes]: ...
|
||||
def multiple_chunks(self, chunk_size: Optional[int] = ...) -> bool: ...
|
||||
|
||||
@@ -8,8 +8,8 @@ from django.utils.datastructures import MultiValueDict
|
||||
class UploadFileException(Exception): ...
|
||||
|
||||
class StopUpload(UploadFileException):
|
||||
connection_reset = ... # type: bool
|
||||
def __init__(self, connection_reset: bool = False) -> None: ...
|
||||
connection_reset: bool = ...
|
||||
def __init__(self, connection_reset: bool = ...) -> None: ...
|
||||
|
||||
class SkipFile(UploadFileException): ...
|
||||
class StopFutureHandlers(UploadFileException): ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import types
|
||||
from typing import Any, TypeVar, Type, Iterable
|
||||
from typing import Any, TypeVar, Type, Iterable, Optional
|
||||
|
||||
from django.core.mail.message import EmailMessage
|
||||
|
||||
@@ -7,7 +7,7 @@ _T = TypeVar("_T", bound="BaseEmailBackend")
|
||||
|
||||
class BaseEmailBackend:
|
||||
def __init__(self, fail_silently: bool = ..., **kwargs: Any) -> None: ...
|
||||
def open(self) -> bool: ...
|
||||
def open(self) -> Optional[bool]: ...
|
||||
def close(self) -> None: ...
|
||||
def __enter__(self: _T) -> _T: ...
|
||||
def __exit__(
|
||||
|
||||
3
django-stubs/core/mail/backends/console.pyi
Normal file
3
django-stubs/core/mail/backends/console.pyi
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.core.mail.backends.base import BaseEmailBackend
|
||||
|
||||
class EmailBackend(BaseEmailBackend): ...
|
||||
3
django-stubs/core/mail/backends/dummy.pyi
Normal file
3
django-stubs/core/mail/backends/dummy.pyi
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.core.mail.backends.base import BaseEmailBackend
|
||||
|
||||
class EmailBackend(BaseEmailBackend): ...
|
||||
3
django-stubs/core/mail/backends/filebased.pyi
Normal file
3
django-stubs/core/mail/backends/filebased.pyi
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.core.mail.backends.base import BaseEmailBackend
|
||||
|
||||
class EmailBackend(BaseEmailBackend): ...
|
||||
3
django-stubs/core/mail/backends/locmem.pyi
Normal file
3
django-stubs/core/mail/backends/locmem.pyi
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.core.mail.backends.base import BaseEmailBackend
|
||||
|
||||
class EmailBackend(BaseEmailBackend): ...
|
||||
18
django-stubs/core/mail/backends/smtp.pyi
Normal file
18
django-stubs/core/mail/backends/smtp.pyi
Normal file
@@ -0,0 +1,18 @@
|
||||
import smtplib
|
||||
import threading
|
||||
from typing import Optional, Union
|
||||
|
||||
from django.core.mail.backends.base import BaseEmailBackend
|
||||
|
||||
class EmailBackend(BaseEmailBackend):
|
||||
host: str = ...
|
||||
port: int = ...
|
||||
username: str = ...
|
||||
password: str = ...
|
||||
use_tls: bool = ...
|
||||
use_ssl: bool = ...
|
||||
timeout: Optional[int] = ...
|
||||
ssl_keyfile: Optional[str] = ...
|
||||
ssl_certfile: Optional[str] = ...
|
||||
connection: Union[smtplib.SMTP_SSL, smtplib.SMTP, None] = ...
|
||||
_lock: threading.RLock = ...
|
||||
@@ -1,8 +1,10 @@
|
||||
from email._policybase import Policy # type: ignore
|
||||
from email.message import Message
|
||||
from email.mime.base import MIMEBase
|
||||
from email.mime.message import MIMEMessage
|
||||
from email.mime.multipart import MIMEMultipart
|
||||
from email.mime.text import MIMEText
|
||||
from typing import Any, Dict, List, Optional, Sequence, Tuple, Union
|
||||
from typing import Any, Dict, List, Optional, Sequence, Tuple, Union, overload
|
||||
|
||||
utf8_charset: Any
|
||||
utf8_charset_qp: Any
|
||||
@@ -43,6 +45,11 @@ class SafeMIMEMultipart(MIMEMixin, MIMEMultipart):
|
||||
self, _subtype: str = ..., boundary: None = ..., _subparts: None = ..., encoding: str = ..., **_params: Any
|
||||
) -> None: ...
|
||||
|
||||
_AttachmentContent = Union[bytes, EmailMessage, Message, SafeMIMEText, str]
|
||||
_AttachmentTuple = Union[
|
||||
Tuple[str, _AttachmentContent], Tuple[Optional[str], _AttachmentContent, str], Tuple[str, _AttachmentContent, None]
|
||||
]
|
||||
|
||||
class EmailMessage:
|
||||
content_subtype: str = ...
|
||||
mixed_subtype: str = ...
|
||||
@@ -62,42 +69,42 @@ class EmailMessage:
|
||||
subject: str = ...,
|
||||
body: Optional[str] = ...,
|
||||
from_email: Optional[str] = ...,
|
||||
to: Optional[Union[Sequence[str], str]] = ...,
|
||||
bcc: Optional[Union[Sequence[str], str]] = ...,
|
||||
to: Optional[Sequence[str]] = ...,
|
||||
bcc: Optional[Sequence[str]] = ...,
|
||||
connection: Optional[Any] = ...,
|
||||
attachments: Optional[Union[List[Tuple[str, Union[str, bytes], str]], List[MIMEText]]] = ...,
|
||||
attachments: Optional[Sequence[Union[MIMEBase, _AttachmentTuple]]] = ...,
|
||||
headers: Optional[Dict[str, str]] = ...,
|
||||
cc: Optional[Union[Sequence[str], str]] = ...,
|
||||
reply_to: Optional[Union[List[Optional[str]], str]] = ...,
|
||||
cc: Optional[Sequence[str]] = ...,
|
||||
reply_to: Optional[Sequence[str]] = ...,
|
||||
) -> None: ...
|
||||
def get_connection(self, fail_silently: bool = ...) -> Any: ...
|
||||
# TODO: when typeshed gets more types for email.Message, move it to MIMEMessage, now it has too many false-positives
|
||||
def message(self) -> Any: ...
|
||||
def recipients(self) -> List[str]: ...
|
||||
def send(self, fail_silently: bool = ...) -> int: ...
|
||||
def attach(
|
||||
self,
|
||||
filename: Optional[Union[MIMEText, str]] = ...,
|
||||
content: Optional[Union[bytes, EmailMessage, SafeMIMEText, str]] = ...,
|
||||
mimetype: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
@overload
|
||||
def attach(self, filename: MIMEText = ...) -> None: ...
|
||||
@overload
|
||||
def attach(self, filename: None = ..., content: _AttachmentContent = ..., mimetype: str = ...) -> None: ...
|
||||
@overload
|
||||
def attach(self, filename: str = ..., content: _AttachmentContent = ..., mimetype: Optional[str] = ...) -> None: ...
|
||||
def attach_file(self, path: str, mimetype: Optional[str] = ...) -> None: ...
|
||||
|
||||
class EmailMultiAlternatives(EmailMessage):
|
||||
alternative_subtype: str = ...
|
||||
alternatives: Any = ...
|
||||
alternatives: Sequence[Tuple[_AttachmentContent, str]] = ...
|
||||
def __init__(
|
||||
self,
|
||||
subject: str = ...,
|
||||
body: str = ...,
|
||||
from_email: Optional[str] = ...,
|
||||
to: Optional[List[str]] = ...,
|
||||
bcc: Optional[List[str]] = ...,
|
||||
to: Optional[Sequence[str]] = ...,
|
||||
bcc: Optional[Sequence[str]] = ...,
|
||||
connection: Optional[Any] = ...,
|
||||
attachments: None = ...,
|
||||
attachments: Optional[Sequence[Union[MIMEBase, _AttachmentTuple]]] = ...,
|
||||
headers: Optional[Dict[str, str]] = ...,
|
||||
alternatives: Optional[List[Tuple[str, str]]] = ...,
|
||||
cc: None = ...,
|
||||
reply_to: None = ...,
|
||||
alternatives: Optional[Sequence[Tuple[_AttachmentContent, str]]] = ...,
|
||||
cc: Optional[Sequence[str]] = ...,
|
||||
reply_to: Optional[Sequence[str]] = ...,
|
||||
) -> None: ...
|
||||
def attach_alternative(self, content: str, mimetype: str) -> None: ...
|
||||
def attach_alternative(self, content: _AttachmentContent, mimetype: str) -> None: ...
|
||||
|
||||
@@ -63,7 +63,7 @@ class BaseCommand:
|
||||
fail_level: int = ...,
|
||||
) -> None: ...
|
||||
def check_migrations(self) -> None: ...
|
||||
def handle(self, *args: Any, **options: Any) -> None: ...
|
||||
def handle(self, *args: Any, **options: Any) -> Optional[str]: ...
|
||||
|
||||
class AppCommand(BaseCommand):
|
||||
missing_args_message: str = ...
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
from collections import Callable
|
||||
|
||||
def supports_color() -> bool: ...
|
||||
|
||||
class Style:
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
import os
|
||||
import re
|
||||
from typing import Any, Pattern, Type, Optional
|
||||
from typing import Any, Optional, Pattern, Type
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.utils.functional import cached_property
|
||||
from django.utils.jslex import prepare_js_for_gettext
|
||||
|
||||
from django.conf import settings
|
||||
from django.utils.translation import templatize
|
||||
|
||||
plural_forms_re: Pattern = ...
|
||||
STATUS_OK: int = ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Dict, List, Optional, Union, Iterable, Sequence, Protocol, Any
|
||||
from typing import Dict, List, Optional, Protocol, Sequence, Union
|
||||
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.query import QuerySet
|
||||
@@ -32,7 +32,9 @@ class Paginator:
|
||||
def validate_number(self, number: Optional[Union[float, str]]) -> int: ...
|
||||
def get_page(self, number: Optional[int]) -> Page: ...
|
||||
def page(self, number: Union[int, str]) -> Page: ...
|
||||
@property
|
||||
def count(self) -> int: ...
|
||||
@property
|
||||
def num_pages(self) -> int: ...
|
||||
@property
|
||||
def page_range(self) -> range: ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from datetime import date
|
||||
from io import BufferedReader, StringIO, TextIOWrapper
|
||||
from typing import Any, Dict, Iterable, List, Mapping, Optional, Type, Union
|
||||
from typing import Any, Dict, Iterable, List, Mapping, Optional, Type, Union, Collection
|
||||
from uuid import UUID
|
||||
|
||||
from django.core.management.base import OutputWrapper
|
||||
@@ -35,18 +35,18 @@ class Serializer:
|
||||
internal_use_only: bool = ...
|
||||
progress_class: Any = ...
|
||||
stream_class: Any = ...
|
||||
options: Any = ...
|
||||
options: Dict[str, Any] = ...
|
||||
stream: Any = ...
|
||||
selected_fields: Any = ...
|
||||
use_natural_foreign_keys: Any = ...
|
||||
use_natural_primary_keys: Any = ...
|
||||
selected_fields: Optional[Collection[str]] = ...
|
||||
use_natural_foreign_keys: bool = ...
|
||||
use_natural_primary_keys: bool = ...
|
||||
first: bool = ...
|
||||
def serialize(
|
||||
self,
|
||||
queryset: Iterable[Model],
|
||||
*,
|
||||
stream: Optional[Any] = ...,
|
||||
fields: Optional[Any] = ...,
|
||||
fields: Optional[Collection[str]] = ...,
|
||||
use_natural_foreign_keys: bool = ...,
|
||||
use_natural_primary_keys: bool = ...,
|
||||
progress_output: Optional[Any] = ...,
|
||||
@@ -63,7 +63,7 @@ class Serializer:
|
||||
def getvalue(self) -> Optional[Union[bytes, str]]: ...
|
||||
|
||||
class Deserializer:
|
||||
options: Any = ...
|
||||
options: Dict[str, Any] = ...
|
||||
stream: Any = ...
|
||||
def __init__(self, stream_or_string: Union[BufferedReader, TextIOWrapper, str], **options: Any) -> None: ...
|
||||
def __iter__(self) -> Deserializer: ...
|
||||
|
||||
@@ -1,24 +1,10 @@
|
||||
import json
|
||||
from datetime import datetime
|
||||
from decimal import Decimal
|
||||
from io import TextIOWrapper
|
||||
from typing import Any, Union, Dict
|
||||
from uuid import UUID
|
||||
from typing import Any, Dict
|
||||
|
||||
from django.core.serializers.python import Serializer as PythonSerializer
|
||||
from django.db.models.base import Model
|
||||
|
||||
class Serializer(PythonSerializer):
|
||||
json_kwargs: Dict[str, Any]
|
||||
options: Dict[str, None]
|
||||
selected_fields: None
|
||||
stream: TextIOWrapper
|
||||
use_natural_foreign_keys: bool
|
||||
use_natural_primary_keys: bool
|
||||
internal_use_only: bool = ...
|
||||
def start_serialization(self) -> None: ...
|
||||
def end_serialization(self) -> None: ...
|
||||
def end_object(self, obj: Model) -> None: ...
|
||||
|
||||
def Deserializer(stream_or_string: Any, **options: Any) -> None: ...
|
||||
|
||||
@@ -29,4 +15,3 @@ class DjangoJSONEncoder(json.JSONEncoder):
|
||||
indent: int
|
||||
skipkeys: bool
|
||||
sort_keys: bool
|
||||
def default(self, o: Union[datetime, Decimal, UUID]) -> str: ...
|
||||
|
||||
@@ -1,31 +1,15 @@
|
||||
from collections import OrderedDict
|
||||
from io import TextIOWrapper
|
||||
from typing import Any, Dict, Iterator, List
|
||||
from typing import Any, Dict, Iterator, List, Optional
|
||||
|
||||
from django.core.serializers.base import DeserializedObject
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.fields.related import ForeignKey, ManyToManyField
|
||||
|
||||
from django.core.serializers import base
|
||||
from django.db.models.fields import Field
|
||||
|
||||
class Serializer(base.Serializer):
|
||||
options: Dict[Any, Any]
|
||||
selected_fields: None
|
||||
stream: TextIOWrapper
|
||||
use_natural_foreign_keys: bool
|
||||
use_natural_primary_keys: bool
|
||||
internal_use_only: bool = ...
|
||||
objects: List[Any] = ...
|
||||
def start_serialization(self) -> None: ...
|
||||
def end_serialization(self) -> None: ...
|
||||
def start_object(self, obj: Model) -> None: ...
|
||||
def end_object(self, obj: Model) -> None: ...
|
||||
def get_dump_object(self, obj: Model) -> OrderedDict: ...
|
||||
def handle_field(self, obj: Model, field: Field) -> None: ...
|
||||
def handle_fk_field(self, obj: Model, field: ForeignKey) -> None: ...
|
||||
def handle_m2m_field(self, obj: Model, field: ManyToManyField) -> None: ...
|
||||
|
||||
def Deserializer(
|
||||
object_list: List[Dict[str, Any]], *, using: Any = ..., ignorenonexistent: bool = ..., **options: Any
|
||||
object_list: List[Dict[str, Any]], *, using: Optional[str] = ..., ignorenonexistent: bool = ..., **options: Any
|
||||
) -> Iterator[DeserializedObject]: ...
|
||||
|
||||
@@ -4,7 +4,7 @@ from typing import Any, Dict
|
||||
from wsgiref import simple_server
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest, WSGIHandler
|
||||
from django.core.wsgi import get_wsgi_application as get_wsgi_application
|
||||
from django.core.wsgi import get_wsgi_application as get_wsgi_application # noqa: F401
|
||||
|
||||
class WSGIServer(simple_server.WSGIServer):
|
||||
request_queue_size: int = ...
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
from datetime import datetime, timedelta
|
||||
from typing import Any, Dict, List, Optional, Type, Union, Protocol
|
||||
|
||||
from django.contrib.sessions.serializers import PickleSerializer
|
||||
from datetime import timedelta
|
||||
from typing import Any, Dict, Optional, Protocol, Type, Union
|
||||
|
||||
class BadSignature(Exception): ...
|
||||
class SignatureExpired(BadSignature): ...
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
from datetime import datetime
|
||||
from decimal import Decimal
|
||||
from re import RegexFlag
|
||||
from typing import Any, Dict, List, Optional, Union, Pattern, Collection
|
||||
from uuid import UUID
|
||||
from typing import Any, Dict, List, Optional, Union, Pattern, Collection, Callable, Tuple
|
||||
|
||||
from django.core.files.base import File
|
||||
from django.core.exceptions import ValidationError as ValidationError
|
||||
|
||||
EMPTY_VALUES: Any
|
||||
|
||||
_Regex = Union[str, Pattern[str]]
|
||||
_ErrorMessage = Union[str, Any]
|
||||
|
||||
def _lazy_re_compile(regex: _Regex, flags: int = ...): ...
|
||||
|
||||
@@ -22,7 +20,7 @@ class RegexValidator:
|
||||
def __init__(
|
||||
self,
|
||||
regex: Optional[_Regex] = ...,
|
||||
message: Optional[str] = ...,
|
||||
message: Optional[_ErrorMessage] = ...,
|
||||
code: Optional[str] = ...,
|
||||
inverse_match: Optional[bool] = ...,
|
||||
flags: Optional[RegexFlag] = ...,
|
||||
@@ -45,67 +43,53 @@ integer_validator: Any
|
||||
def validate_integer(value: Optional[Union[float, str]]) -> None: ...
|
||||
|
||||
class EmailValidator:
|
||||
message: Any = ...
|
||||
message: str = ...
|
||||
code: str = ...
|
||||
user_regex: Any = ...
|
||||
domain_regex: Any = ...
|
||||
literal_regex: Any = ...
|
||||
domain_whitelist: Any = ...
|
||||
def __init__(
|
||||
self, message: Optional[str] = ..., code: Optional[str] = ..., whitelist: Optional[Collection[str]] = ...
|
||||
self,
|
||||
message: Optional[_ErrorMessage] = ...,
|
||||
code: Optional[str] = ...,
|
||||
whitelist: Optional[Collection[str]] = ...,
|
||||
) -> None: ...
|
||||
def __call__(self, value: Optional[str]) -> None: ...
|
||||
def validate_domain_part(self, domain_part: str) -> bool: ...
|
||||
|
||||
validate_email: Any
|
||||
slug_re: Any
|
||||
validate_slug: Any
|
||||
slug_unicode_re: Any
|
||||
validate_unicode_slug: Any
|
||||
validate_email: EmailValidator = ...
|
||||
slug_re: Pattern = ...
|
||||
validate_slug: RegexValidator = ...
|
||||
slug_unicode_re: Pattern = ...
|
||||
validate_unicode_slug: RegexValidator = ...
|
||||
|
||||
def validate_ipv4_address(value: str) -> None: ...
|
||||
def validate_ipv6_address(value: str) -> None: ...
|
||||
def validate_ipv46_address(value: str) -> None: ...
|
||||
|
||||
ip_address_validator_map: Any
|
||||
ip_address_validator_map: Dict[str, Tuple[Callable[[Any], None], str]]
|
||||
|
||||
def ip_address_validators(protocol: str, unpack_ipv4: bool) -> Any: ...
|
||||
def int_list_validator(
|
||||
sep: str = ..., message: None = ..., code: str = ..., allow_negative: bool = ...
|
||||
sep: str = ..., message: Optional[_ErrorMessage] = ..., code: str = ..., allow_negative: bool = ...
|
||||
) -> RegexValidator: ...
|
||||
|
||||
validate_comma_separated_integer_list: Any
|
||||
|
||||
class BaseValidator:
|
||||
message: Any = ...
|
||||
message: str = ...
|
||||
code: str = ...
|
||||
limit_value: Any = ...
|
||||
def __init__(self, limit_value: Any, message: Optional[str] = ...) -> None: ...
|
||||
def __init__(self, limit_value: Any, message: Optional[_ErrorMessage] = ...) -> None: ...
|
||||
def __call__(self, value: Any) -> None: ...
|
||||
def compare(self, a: bool, b: bool) -> bool: ...
|
||||
def compare(self, a: Any, b: Any) -> bool: ...
|
||||
def clean(self, x: Any) -> Any: ...
|
||||
|
||||
class MaxValueValidator(BaseValidator):
|
||||
message: Any = ...
|
||||
code: str = ...
|
||||
def compare(self, a: Union[datetime, Decimal, float], b: Union[datetime, Decimal, float]) -> bool: ...
|
||||
|
||||
class MinValueValidator(BaseValidator):
|
||||
message: Any = ...
|
||||
code: str = ...
|
||||
def compare(self, a: Union[datetime, Decimal, float], b: Union[datetime, Decimal, float]) -> bool: ...
|
||||
|
||||
class MinLengthValidator(BaseValidator):
|
||||
message: Any = ...
|
||||
code: str = ...
|
||||
def compare(self, a: int, b: int) -> bool: ...
|
||||
def clean(self, x: str) -> int: ...
|
||||
|
||||
class MaxLengthValidator(BaseValidator):
|
||||
message: Any = ...
|
||||
code: str = ...
|
||||
def compare(self, a: int, b: int) -> bool: ...
|
||||
def clean(self, x: Union[bytes, str]) -> int: ...
|
||||
class MaxValueValidator(BaseValidator): ...
|
||||
class MinValueValidator(BaseValidator): ...
|
||||
class MinLengthValidator(BaseValidator): ...
|
||||
class MaxLengthValidator(BaseValidator): ...
|
||||
|
||||
class DecimalValidator:
|
||||
messages: Any = ...
|
||||
@@ -115,13 +99,13 @@ class DecimalValidator:
|
||||
def __call__(self, value: Decimal) -> None: ...
|
||||
|
||||
class FileExtensionValidator:
|
||||
message: Any = ...
|
||||
message: str = ...
|
||||
code: str = ...
|
||||
allowed_extensions: List[str] = ...
|
||||
def __init__(
|
||||
self,
|
||||
allowed_extensions: Optional[Collection[str]] = ...,
|
||||
message: Optional[str] = ...,
|
||||
message: Optional[_ErrorMessage] = ...,
|
||||
code: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
def __call__(self, value: File) -> None: ...
|
||||
@@ -130,7 +114,7 @@ def get_available_image_extensions() -> List[str]: ...
|
||||
def validate_image_file_extension(value: File) -> None: ...
|
||||
|
||||
class ProhibitNullCharactersValidator:
|
||||
message: Any = ...
|
||||
message: str = ...
|
||||
code: str = ...
|
||||
def __init__(self, message: Optional[str] = ..., code: Optional[str] = ...) -> None: ...
|
||||
def __call__(self, value: Optional[Union[Dict[Any, Any], str, UUID]]) -> None: ...
|
||||
def __init__(self, message: Optional[_ErrorMessage] = ..., code: Optional[str] = ...) -> None: ...
|
||||
def __call__(self, value: Any) -> None: ...
|
||||
|
||||
@@ -20,7 +20,7 @@ class BaseDatabaseWrapper:
|
||||
ops: Any = ...
|
||||
vendor: str = ...
|
||||
display_name: str = ...
|
||||
SchemaEditorClass: Any = ...
|
||||
SchemaEditorClass: Optional[BaseDatabaseSchemaEditor] = ...
|
||||
client_class: Any = ...
|
||||
creation_class: Any = ...
|
||||
features_class: Any = ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
from django.db.backends.base.base import BaseDatabaseWrapper
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
|
||||
from django.db.backends.base.base import BaseDatabaseWrapper
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from collections import namedtuple
|
||||
from typing import Any, Dict, List, Optional, Set, Tuple, Type, Union
|
||||
from typing import Any, Dict, List, Optional, Set, Type
|
||||
|
||||
from django.db.backends.base.base import BaseDatabaseWrapper
|
||||
from django.db.backends.utils import CursorWrapper
|
||||
@@ -13,7 +13,7 @@ class BaseDatabaseIntrospection:
|
||||
data_types_reverse: Any = ...
|
||||
connection: Any = ...
|
||||
def __init__(self, connection: BaseDatabaseWrapper) -> None: ...
|
||||
def get_field_type(self, data_type: str, description: FieldInfo) -> Union[Tuple[str, Dict[str, int]], str]: ...
|
||||
def get_field_type(self, data_type: str, description: FieldInfo) -> str: ...
|
||||
def table_name_converter(self, name: str) -> str: ...
|
||||
def column_name_converter(self, name: str) -> str: ...
|
||||
def table_names(self, cursor: Optional[CursorWrapper] = ..., include_views: bool = ...) -> List[str]: ...
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
from datetime import date, datetime, timedelta
|
||||
from datetime import date, datetime, timedelta, time
|
||||
from decimal import Decimal
|
||||
from typing import Any, List, Optional, Set, Tuple, Type, Union, Sequence
|
||||
from typing import Any, List, Optional, Sequence, Tuple, Type, Union
|
||||
|
||||
from django.core.management.color import Style
|
||||
from django.db import DefaultConnectionProxy
|
||||
from django.db.backends.base.base import BaseDatabaseWrapper
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.backends.utils import CursorWrapper
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.expressions import Case, Expression
|
||||
from django.db.models.fields import Field
|
||||
from django.db.models.sql.compiler import SQLCompiler
|
||||
|
||||
from django.db import DefaultConnectionProxy
|
||||
from django.db.models.fields import Field
|
||||
|
||||
_Connection = Union[DefaultConnectionProxy, BaseDatabaseWrapper]
|
||||
|
||||
class BaseDatabaseOperations:
|
||||
compiler_module: str = ...
|
||||
integer_field_ranges: Any = ...
|
||||
@@ -24,8 +26,8 @@ class BaseDatabaseOperations:
|
||||
UNBOUNDED_FOLLOWING: Any = ...
|
||||
CURRENT_ROW: str = ...
|
||||
explain_prefix: Any = ...
|
||||
connection: Any = ...
|
||||
def __init__(self, connection: Optional[Union[DefaultConnectionProxy, BaseDatabaseWrapper]]) -> None: ...
|
||||
connection: _Connection = ...
|
||||
def __init__(self, connection: Optional[_Connection]) -> None: ...
|
||||
def autoinc_sql(self, table: str, column: str) -> None: ...
|
||||
def bulk_batch_size(self, fields: Any, objs: Any): ...
|
||||
def cache_key_culling_sql(self) -> str: ...
|
||||
@@ -74,10 +76,10 @@ class BaseDatabaseOperations:
|
||||
def prep_for_like_query(self, x: str) -> str: ...
|
||||
prep_for_iexact_query: Any = ...
|
||||
def validate_autopk_value(self, value: int) -> int: ...
|
||||
def adapt_unknown_value(self, value: Union[datetime, Decimal, int, str]) -> Union[int, str]: ...
|
||||
def adapt_unknown_value(self, value: Any) -> Any: ...
|
||||
def adapt_datefield_value(self, value: Optional[date]) -> Optional[str]: ...
|
||||
def adapt_datetimefield_value(self, value: None) -> None: ...
|
||||
def adapt_timefield_value(self, value: Optional[datetime]) -> Optional[str]: ...
|
||||
def adapt_datetimefield_value(self, value: Optional[datetime]) -> Optional[str]: ...
|
||||
def adapt_timefield_value(self, value: Optional[Union[datetime, time]]) -> Optional[str]: ...
|
||||
def adapt_decimalfield_value(
|
||||
self, value: Optional[Decimal], max_digits: Optional[int] = ..., decimal_places: Optional[int] = ...
|
||||
) -> Optional[str]: ...
|
||||
@@ -86,19 +88,17 @@ class BaseDatabaseOperations:
|
||||
def year_lookup_bounds_for_datetime_field(self, value: int) -> List[str]: ...
|
||||
def get_db_converters(self, expression: Expression) -> List[Any]: ...
|
||||
def convert_durationfield_value(
|
||||
self, value: Optional[float], expression: Expression, connection: DatabaseWrapper
|
||||
self, value: Optional[float], expression: Expression, connection: _Connection
|
||||
) -> Optional[timedelta]: ...
|
||||
def check_expression_support(self, expression: Any) -> None: ...
|
||||
def combine_expression(self, connector: str, sub_expressions: List[str]) -> str: ...
|
||||
def combine_duration_expression(self, connector: Any, sub_expressions: Any): ...
|
||||
def binary_placeholder_sql(self, value: Optional[Case]) -> str: ...
|
||||
def modify_insert_params(
|
||||
self, placeholder: str, params: Union[List[None], List[bool], List[float], List[str]]
|
||||
) -> Union[List[None], List[bool], List[float], List[str]]: ...
|
||||
def modify_insert_params(self, placeholder: str, params: Any) -> Any: ...
|
||||
def integer_field_range(self, internal_type: Any): ...
|
||||
def subtract_temporals(self, internal_type: Any, lhs: Any, rhs: Any): ...
|
||||
def window_frame_start(self, start: Any): ...
|
||||
def window_frame_end(self, end: Any): ...
|
||||
def window_frame_rows_start_end(self, start: None = ..., end: None = ...) -> Any: ...
|
||||
def window_frame_range_start_end(self, start: Optional[Any] = ..., end: Optional[Any] = ...): ...
|
||||
def window_frame_rows_start_end(self, start: Optional[int] = ..., end: Optional[int] = ...) -> Any: ...
|
||||
def window_frame_range_start_end(self, start: Optional[int] = ..., end: Optional[int] = ...) -> Any: ...
|
||||
def explain_query_prefix(self, format: Optional[str] = ..., **options: Any) -> str: ...
|
||||
|
||||
@@ -48,7 +48,7 @@ class BaseDatabaseSchemaEditor(ContextManager[Any]):
|
||||
def quote_name(self, name: str) -> str: ...
|
||||
def column_sql(
|
||||
self, model: Type[Model], field: Field, include_default: bool = ...
|
||||
) -> Union[Tuple[None, None], Tuple[str, List[Any]]]: ...
|
||||
) -> Tuple[Optional[str], Optional[List[Any]]]: ...
|
||||
def skip_default(self, field: Any): ...
|
||||
def prepare_default(self, value: Any) -> None: ...
|
||||
def effective_default(self, field: Field) -> Optional[Union[int, str]]: ...
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user