Skip to content

Conversation

@nils-van-zuijlen
Copy link
Contributor

… and urlencode

Following on typeddjango/djangorestframework-stubs#267 by adding the same typing information to the corresponding django stubs.

The data parameter in both get methods is fed to urlencode, and that function takes either a mapping or a list of tuples of URL parameters.

@intgr intgr self-requested a review December 21, 2022 15:28
@intgr intgr changed the title Add typing for data parameter in get from RequestFactory, test Client… Add typing for data parameter in get from RequestFactory, test Client and urlencode Dec 21, 2022
Copy link
Collaborator

@intgr intgr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the from typing_extensions import TypeAlias myself and this now passes tests.

In the related djangorestframework-stubs PR (typeddjango/djangorestframework-stubs#267 (comment)) we had the dilemma about allowing int. I don't feel strongly about that, it can be added later if someone finds it useful.

@intgr intgr merged commit eff8175 into typeddjango:master Jan 4, 2023
@intgr
Copy link
Collaborator

intgr commented Jan 4, 2023

Thanks! 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants