From cda703a94bc36fe3c5d1c620c692ed6b314a061e Mon Sep 17 00:00:00 2001 From: Seth Yastrov Date: Wed, 20 Feb 2019 20:51:43 +0100 Subject: [PATCH] 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. --- django-stubs/db/models/query.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django-stubs/db/models/query.pyi b/django-stubs/db/models/query.pyi index 7f0f44c..670927f 100644 --- a/django-stubs/db/models/query.pyi +++ b/django-stubs/db/models/query.pyi @@ -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]: ...