Merge pull request #20 from HackSoftware/queryset-type-add-typings

Update typings of QuerySetType
This commit is contained in:
Ivaylo Donchev 2019-08-19 13:53:46 +03:00 committed by GitHub
commit 8ce40d76af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
@ -44,6 +53,19 @@ class QuerySetType(Generic[DjangoModel], extra=Iterable):
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 __or__(
self,
qs: "QuerySetType[DjangoModel]"
) -> 'QuerySetType[DjangoModel]': ...
def __and__(
self,
qs: "QuerySetType[DjangoModel]"
) -> 'QuerySetType[DjangoModel]': ...