Skip to content
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

fix .values_list returns incorrect type for field with same name when selected from related model #2431

Merged

Conversation

Niicck
Copy link
Contributor

@Niicck Niicck commented Nov 3, 2024

Fix .values_list bug that returns incorrect type for field with same name when selected from related model

get_field_type_from_lookup will now check the correct related_model to get a field's type. Previously, it was only ever checking the original model.

Related issues

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Thanks!

tests/typecheck/managers/querysets/test_values_list.yml Outdated Show resolved Hide resolved
tests/typecheck/managers/querysets/test_values_list.yml Outdated Show resolved Hide resolved
@Niicck Niicck requested a review from sobolevn November 4, 2024 14:43
Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Thank you!

@sobolevn sobolevn merged commit a7e3728 into typeddjango:master Nov 4, 2024
40 checks passed
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.

.values_list returns incorrect type for field with same name when selected from related model
2 participants