mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-15 16:27:09 +08:00
better stubs
This commit is contained in:
@@ -1,13 +1,9 @@
|
||||
# Stubs for django.core.paginator (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
import collections.abc
|
||||
from typing import Any
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
|
||||
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): ...
|
||||
@@ -15,42 +11,43 @@ class PageNotAnInteger(InvalidPage): ...
|
||||
class EmptyPage(InvalidPage): ...
|
||||
|
||||
class Paginator:
|
||||
object_list: Any = ...
|
||||
per_page: Any = ...
|
||||
orphans: Any = ...
|
||||
allow_empty_first_page: Any = ...
|
||||
object_list: django.db.models.query.QuerySet = ...
|
||||
per_page: int = ...
|
||||
orphans: int = ...
|
||||
allow_empty_first_page: bool = ...
|
||||
def __init__(
|
||||
self,
|
||||
object_list: Union[List[int], QuerySet, List[object]],
|
||||
object_list: Union[
|
||||
QuerySet, List[int], List[Dict[str, str]], str, List[Model]
|
||||
],
|
||||
per_page: Union[str, int],
|
||||
orphans: Union[str, int] = ...,
|
||||
orphans: 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: ...
|
||||
def _get_page(self, *args: Any, **kwargs: Any) -> Page: ...
|
||||
def count(self) -> int: ...
|
||||
def num_pages(self) -> int: ...
|
||||
@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 = ...
|
||||
object_list: django.db.models.query.QuerySet = ...
|
||||
number: int = ...
|
||||
paginator: django.core.paginator.Paginator = ...
|
||||
def __init__(
|
||||
self,
|
||||
object_list: Union[List[int], str, List[object], QuerySet],
|
||||
object_list: Union[
|
||||
QuerySet, List[int], List[Dict[str, str]], str, List[Model]
|
||||
],
|
||||
number: int,
|
||||
paginator: Paginator,
|
||||
) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def __len__(self): ...
|
||||
def __getitem__(self, index: Union[slice, int]) -> Union[List[Model], str]: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __getitem__(self, index: Union[str, int]) -> Union[Model, str]: ...
|
||||
def has_next(self) -> bool: ...
|
||||
def has_previous(self) -> bool: ...
|
||||
def has_other_pages(self) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user