Skip to content

Resolve .values() field types on annotated querysets#3232

Open
federicobond wants to merge 1 commit intotypeddjango:masterfrom
federicobond:feat/resolve-annotated-field-types
Open

Resolve .values() field types on annotated querysets#3232
federicobond wants to merge 1 commit intotypeddjango:masterfrom
federicobond:feat/resolve-annotated-field-types

Conversation

@federicobond
Copy link
Copy Markdown
Contributor

Previously, extract_proper_type_queryset_values bailed out early for annotated models, returning dict[str, Any] instead of a precise TypedDict. Now it resolves annotation fields from the model's TypedDict type arg and model fields from Django's field metadata.

I've been working on values_list too but this changeset ended up quite neat that I didn't want to introduce more friction.

@federicobond federicobond force-pushed the feat/resolve-annotated-field-types branch from 9eb8e04 to 041a3ab Compare March 28, 2026 15:12
Previously, extract_proper_type_queryset_values bailed out early for
annotated models, returning dict[str, Any] instead of a precise TypedDict.
Now it resolves annotation fields from the model's TypedDict type arg and
model fields from Django's field metadata.
@federicobond federicobond force-pushed the feat/resolve-annotated-field-types branch from 041a3ab to f69886f Compare March 29, 2026 05:44
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.

3 participants