File: __init__.pyi

package info (click to toggle)
python-django-stubs 5.2.9-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,832 kB
  • sloc: python: 5,185; makefile: 15; sh: 8
file content (25 lines) | stat: -rw-r--r-- 1,196 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from collections.abc import Callable, Iterable, Iterator
from typing import Any

from django.db.models.base import Model

from .base import DeserializedObject, Deserializer, Serializer
from .base import SerializerDoesNotExist as SerializerDoesNotExist

BUILTIN_SERIALIZERS: dict[str, str]

class BadSerializer:
    internal_use_only: bool
    exception: BaseException
    def __init__(self, exception: BaseException) -> None: ...
    def __call__(self, *args: Any, **kwargs: Any) -> Any: ...

def register_serializer(format: str, serializer_module: str, serializers: dict[str, Any] | None = None) -> None: ...
def unregister_serializer(format: str) -> None: ...
def get_serializer(format: str) -> type[Serializer] | BadSerializer: ...
def get_serializer_formats() -> list[str]: ...
def get_public_serializer_formats() -> list[str]: ...
def get_deserializer(format: str) -> Callable | type[Deserializer]: ...
def serialize(format: str, queryset: Iterable[Model], **options: Any) -> Any: ...
def deserialize(format: str, stream_or_string: Any, **options: Any) -> Iterator[DeserializedObject]: ...
def sort_dependencies(app_list: Iterable[Any], allow_cycles: bool = False) -> list[type[Model]]: ...