Skip to content

Add typing for data parameter in get from RequestFactory, test Client and urlencode #1297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 4, 2023

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