move django.core stubs

This commit is contained in:
Maxim Kurnikov
2018-12-21 01:17:17 +03:00
parent b74aa896b5
commit c22e86377d
77 changed files with 1420 additions and 1021 deletions

View File

@@ -0,0 +1,52 @@
import collections.abc
from typing import Dict, List, Optional, Union
from django.db.models.base import Model
from django.db.models.query import QuerySet
class UnorderedObjectListWarning(RuntimeWarning): ...
class InvalidPage(Exception): ...
class PageNotAnInteger(InvalidPage): ...
class EmptyPage(InvalidPage): ...
class Paginator:
object_list: QuerySet = ...
per_page: int = ...
orphans: int = ...
allow_empty_first_page: bool = ...
def __init__(
self,
object_list: Union[List[Dict[str, str]], List[Model], List[int], QuerySet, str],
per_page: Union[int, str],
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[int, str]) -> Page: ...
def count(self) -> int: ...
def num_pages(self) -> int: ...
@property
def page_range(self) -> range: ...
QuerySetPaginator = Paginator
class Page(collections.abc.Sequence):
object_list: QuerySet = ...
number: int = ...
paginator: Paginator = ...
def __init__(
self,
object_list: Union[List[Dict[str, str]], List[Model], List[int], QuerySet, str],
number: int,
paginator: Paginator,
) -> None: ...
def __len__(self) -> int: ...
def __getitem__(self, index: Union[int, str]) -> Union[Model, str]: ...
def has_next(self) -> bool: ...
def has_previous(self) -> bool: ...
def has_other_pages(self) -> bool: ...
def next_page_number(self) -> int: ...
def previous_page_number(self) -> int: ...
def start_index(self) -> int: ...
def end_index(self) -> int: ...