Skip to content

change render_to_string context type #1306

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 1 commit into from
Dec 31, 2022

Conversation

mschoettle
Copy link
Contributor

I have made things!

Change context argument of render_to_string to dict[str, Any] | None

The documentation states for the context argument

A dict to be used as the template’s context for rendering.

See: https://docs.djangoproject.com/en/dev/topics/templates/#django.template.loader.render_to_string
See: https://docs.djangoproject.com/en/dev/topics/templates/#django.template.engine.render_to_string

If I am misunderstanding anything with the change to Mapping[_ContextKeys, ...] let me know please.

Related issues

Refs #1298

@mschoettle mschoettle force-pushed the render-to-string-context branch from 7a41139 to 9f0715d Compare December 31, 2022 03:22
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.

Since we don't have typeddict support anyway, we can use dict

@sobolevn sobolevn merged commit f34a626 into typeddjango:master Dec 31, 2022
@sobolevn
Copy link
Member

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