mirror of
https://github.com/HackSoftware/Django-Styleguide.git
synced 2024-11-14 05:36:40 +03:00
Add typings:
- add typing for `__or__` - add typing for `__and__` - update typing for `__getitem__`
This commit is contained in:
parent
0570b34dce
commit
a6f3933bb0
|
@ -1,4 +1,13 @@
|
||||||
from typing import Generic, Iterator, Any, TypeVar, Optional, Dict, Tuple
|
from typing import (
|
||||||
|
Generic,
|
||||||
|
Iterator,
|
||||||
|
Any,
|
||||||
|
TypeVar,
|
||||||
|
Optional,
|
||||||
|
Dict,
|
||||||
|
Tuple,
|
||||||
|
Union
|
||||||
|
)
|
||||||
from collections import Iterable
|
from collections import Iterable
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,6 +53,19 @@ class QuerySetType(Generic[DjangoModel], extra=Iterable):
|
||||||
|
|
||||||
def values_list(self, *args: Any) -> 'QuerySetType[DjangoModel]': ...
|
def values_list(self, *args: Any) -> 'QuerySetType[DjangoModel]': ...
|
||||||
|
|
||||||
def __getitem__(self, index: int) -> DjangoModel: ...
|
def __getitem__(
|
||||||
|
self,
|
||||||
|
index: int
|
||||||
|
) -> Union[DjangoModel, "QuerySetType[DjangoModel]"]: ...
|
||||||
|
|
||||||
def __len__(self) -> int: ...
|
def __len__(self) -> int: ...
|
||||||
|
|
||||||
|
def __or__(
|
||||||
|
self,
|
||||||
|
qs: "QuerySetType[DjangoModel]"
|
||||||
|
) -> 'QuerySetType[DjangoModel]': ...
|
||||||
|
|
||||||
|
def __and__(
|
||||||
|
self,
|
||||||
|
qs: "QuerySetType[DjangoModel]"
|
||||||
|
) -> 'QuerySetType[DjangoModel]': ...
|
||||||
|
|
Loading…
Reference in New Issue
Block a user