QuerySet.in_bulk returns Dict with values of correct model type.

- The keys are still Union[int, str] which doesn't cover all
possibilities, but it's not possible to cover without handling this in
the plugin, because the type of the Dict keys are dynamic depending on
which value for field_name you pass in.
This commit is contained in:
Seth Yastrov
2019-02-20 20:51:43 +01:00
parent 2bd018951b
commit cda703a94b

View File

@@ -86,7 +86,7 @@ class QuerySet(Iterable[_T], Sized):
def last(self) -> Optional[_T]: ...
def in_bulk(
self, id_list: Any = ..., *, field_name: str = ..., **kwargs: Any
) -> Dict[Union[int, str], models.Model]: ...
) -> Dict[Union[int, str], _T]: ...
def delete(self) -> Tuple[int, Dict[str, int]]: ...
def update(self, **kwargs: Any) -> int: ...
def _update(self, values: Any) -> Optional[Any]: ...