typeddjango / djangorestframework-stubs

PEP-484 stubs for django-rest-framework
MIT License
439 stars 115 forks source link

Allow `None` for `HyperlinkedRelatedField.get_url(format=)` parameter #485

Closed 4c0n closed 11 months ago

4c0n commented 11 months ago

I have made things!

Hi! I ran into a false positive when running mypy in combination with this package. Actually the format parameter can also be None in the get_url() method, it is passed to reverse() where the default value also is None. We've been using it like this in our application for a long time and it works fine like that. Please see: https://github.com/encode/django-rest-framework/blob/3.14.0/rest_framework/relations.py#L326 https://github.com/encode/django-rest-framework/blob/3.14.0/rest_framework/reverse.py#L32

Thanks in advance for your time and consideration.

Related issues

I didn't create an issue, should I?