Skip to content

Commit

Permalink
Set type parameters for Field in get_fields() (#882)
Browse files Browse the repository at this point in the history
* Set type parameters for Field in get_fields()

This fixes an issue with Pyright strict type checking where Pyright complains that the type parameters aren't known.

* Fix type parameters in other methods
  • Loading branch information
w0rp authored Mar 24, 2022
1 parent 32a33c3 commit 1672b54
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions django-stubs/db/models/options.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ class Options(Generic[_M]):
def installed(self): ...
def contribute_to_class(self, cls: Type[Model], name: str) -> None: ...
def add_manager(self, manager: Manager) -> None: ...
def add_field(self, field: Union[GenericForeignKey, Field], private: bool = ...) -> None: ...
def setup_pk(self, field: Field) -> None: ...
def add_field(self, field: Union[GenericForeignKey, Field[Any, Any]], private: bool = ...) -> None: ...
def setup_pk(self, field: Field[Any, Any]) -> None: ...
def setup_proxy(self, target: Type[Model]) -> None: ...
def can_migrate(self, connection: Union[BaseDatabaseWrapper, str]) -> bool: ...
@property
Expand All @@ -104,7 +104,7 @@ class Options(Generic[_M]):
@property
def many_to_many(self) -> List[ManyToManyField]: ...
@property
def fields_map(self) -> Dict[str, Union[Field, ForeignObjectRel]]: ...
def fields_map(self) -> Dict[str, Union[Field[Any, Any], ForeignObjectRel]]: ...
@property
def managers(self) -> List[Manager]: ...
@property
Expand All @@ -119,4 +119,4 @@ class Options(Generic[_M]):
def get_path_from_parent(self, parent: Type[Model]) -> List[PathInfo]: ...
def get_fields(
self, include_parents: bool = ..., include_hidden: bool = ...
) -> List[Union[Field, ForeignObjectRel]]: ...
) -> List[Union[Field[Any, Any], ForeignObjectRel]]: ...

0 comments on commit 1672b54

Please sign in to comment.