Skip to content

Commit

Permalink
fix(relations): replace the model type TypeVar with Any
Browse files Browse the repository at this point in the history
Ref #168
  • Loading branch information
Linkid committed May 7, 2024
1 parent 5ac16c1 commit e9fe7bd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rest_framework-stubs/relations.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ class RelatedField(Field[_MT, Any, _PT, Any]):
def iter_options(self) -> Iterable[Option]: ...
def display_value(self, instance: _MT) -> str: ...

class StringRelatedField(RelatedField[_MT, str]): ...
class StringRelatedField(RelatedField[Any, str]): ...

class PrimaryKeyRelatedField(RelatedField[_MT, Any]):
class PrimaryKeyRelatedField(RelatedField[Any, Any]):
pk_field: str | None
def __init__(
self,
Expand All @@ -98,7 +98,7 @@ class PrimaryKeyRelatedField(RelatedField[_MT, Any]):
pk_field: str | Field | None = ...,
) -> None: ...

class HyperlinkedRelatedField(RelatedField[_MT, Hyperlink]):
class HyperlinkedRelatedField(RelatedField[Any, Hyperlink]):
reverse: Callable
lookup_field: str
lookup_url_kwarg: str
Expand Down Expand Up @@ -134,7 +134,7 @@ class HyperlinkedRelatedField(RelatedField[_MT, Hyperlink]):

class HyperlinkedIdentityField(HyperlinkedRelatedField): ...

class SlugRelatedField(RelatedField[_MT, str]):
class SlugRelatedField(RelatedField[Any, str]):
slug_field: str | None
def __init__(
self,
Expand Down

0 comments on commit e9fe7bd

Please sign in to comment.