mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-19 18:31:15 +08:00
reformat with black
This commit is contained in:
@@ -8,6 +8,7 @@ from typing import Any
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.query import QuerySet
|
||||
from typing import List, Optional, Union
|
||||
|
||||
class UnorderedObjectListWarning(RuntimeWarning): ...
|
||||
class InvalidPage(Exception): ...
|
||||
class PageNotAnInteger(InvalidPage): ...
|
||||
@@ -18,7 +19,13 @@ class Paginator:
|
||||
per_page: Any = ...
|
||||
orphans: Any = ...
|
||||
allow_empty_first_page: Any = ...
|
||||
def __init__(self, object_list: Union[List[int], QuerySet, List[object]], per_page: Union[str, int], orphans: Union[str, int] = ..., allow_empty_first_page: bool = ...) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
object_list: Union[List[int], QuerySet, List[object]],
|
||||
per_page: Union[str, int],
|
||||
orphans: Union[str, int] = ...,
|
||||
allow_empty_first_page: bool = ...,
|
||||
) -> None: ...
|
||||
def validate_number(self, number: Optional[Union[float, str]]) -> int: ...
|
||||
def get_page(self, number: Optional[int]) -> Page: ...
|
||||
def page(self, number: Union[str, int]) -> Page: ...
|
||||
@@ -28,13 +35,19 @@ class Paginator:
|
||||
@property
|
||||
def page_range(self) -> range: ...
|
||||
def _check_object_list_is_ordered(self) -> None: ...
|
||||
|
||||
QuerySetPaginator = Paginator
|
||||
|
||||
class Page(collections.abc.Sequence):
|
||||
object_list: Any = ...
|
||||
number: Any = ...
|
||||
paginator: Any = ...
|
||||
def __init__(self, object_list: Union[List[int], str, List[object], QuerySet], number: int, paginator: Paginator) -> None: ...
|
||||
def __init__(
|
||||
self,
|
||||
object_list: Union[List[int], str, List[object], QuerySet],
|
||||
number: int,
|
||||
paginator: Paginator,
|
||||
) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def __len__(self): ...
|
||||
def __getitem__(self, index: Union[slice, int]) -> Union[List[Model], str]: ...
|
||||
|
||||
Reference in New Issue
Block a user