mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-11 06:21:58 +08:00
Set type parameters for Field in get_fields() (#882)
* 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
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
@@ -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]]: ...
|
||||
|
||||
Reference in New Issue
Block a user