djangorestframework-stubs icon indicating copy to clipboard operation
djangorestframework-stubs copied to clipboard

Should SlugRelatedField.slug_field be optional?

Open YPCrumble opened this issue 3 years ago • 0 comments

Bug report

What's wrong

SlugRelatedField has None for a default parameter in its init function, but there is an assertion that prevents it from ever being None: https://github.com/encode/django-rest-framework/blob/0323d6f8955f987771269506ca5da461e2e7a248/rest_framework/relations.py#L455

What I think this means is that in these types, slug_field should not be Optional here: https://github.com/typeddjango/djangorestframework-stubs/blob/master/rest_framework-stubs/relations.pyi#L133

Thanks for maintaining this repo and for considering this issue! I'd be happy to make the PR if it's desirable.

YPCrumble avatar Apr 05 '22 20:04 YPCrumble