typeddjango / djangorestframework-stubs

PEP-484 stubs for django-rest-framework
MIT License
452 stars 118 forks source link

Export imported modules in serializers.pyi. Fixes: #599 #600

Closed SukiCZ closed 7 months ago

SukiCZ commented 7 months ago

I have made things!

According to PEP-484 Stub Files imported modules are not exported by default unless from ... import ... as ... is used. This exports UniqueTogetherValidator and aligns imports in serializers.

Related issues

Other imports should be exported as well. Following command prints 128 lines.

grep -r 'from rest_framework' rest_framework-stubs | grep -v ' as '

I know, some of those imports are not meant to be exported (e.g. they are not imported in rest_framework itself). I'm thinking about finding them automatically and maybe extend this PR for mode imports?