From 059471101ca4f4b300f09cd43384c398d1e2a6df Mon Sep 17 00:00:00 2001 From: w0rp Date: Mon, 13 Dec 2021 17:05:23 +0000 Subject: [PATCH] Fix the get_field type for Pyright (#773) This PR fixes the type of get_field so it won't report errors in Pyright's strictest type checking mode. --- django-stubs/db/models/options.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django-stubs/db/models/options.pyi b/django-stubs/db/models/options.pyi index e25d2f6..3b2f05d 100644 --- a/django-stubs/db/models/options.pyi +++ b/django-stubs/db/models/options.pyi @@ -111,7 +111,7 @@ class Options(Generic[_M]): def managers_map(self) -> Dict[str, Manager]: ... @property def db_returning_fields(self) -> List[Field]: ... - def get_field(self, field_name: Union[Callable, str]) -> Field: ... + def get_field(self, field_name: Union[Callable[..., Any], str]) -> Field[Any, Any]: ... def get_base_chain(self, model: Type[Model]) -> List[Type[Model]]: ... def get_parent_list(self) -> List[Type[Model]]: ... def get_ancestor_link(self, ancestor: Type[Model]) -> Optional[OneToOneField]: ...