Closed Alexerson closed 6 months ago
It seems that the following changes introduced a bug: https://github.com/typeddjango/djangorestframework-stubs/commit/133e572f08c83c5048a88891686d399e496812f0
It’s possible to not pass any view_name to a HyperlinkedRelatedField if you create a subclass that will define the view_name directly.
view_name
HyperlinkedRelatedField
For instance:
class BookField(serializers.HyperlinkedRelatedField): view_name = 'book-detail' def get_queryset(self): return Book.objects.all()
is valid. Right now mypy wrongfully complains with:
error: Missing positional argument "view_name" in call to "BookField" [call-arg]
It seems that the following changes introduced a bug: https://github.com/typeddjango/djangorestframework-stubs/commit/133e572f08c83c5048a88891686d399e496812f0
It’s possible to not pass any
view_name
to aHyperlinkedRelatedField
if you create a subclass that will define theview_name
directly.For instance:
is valid. Right now mypy wrongfully complains with: