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

Add render_kw support (#40) #42

Merged
merged 4 commits into from Nov 1, 2023
Merged

Add render_kw support (#40) #42

merged 4 commits into from Nov 1, 2023

Conversation

ghost
Copy link

@ghost ghost commented Oct 21, 2023

WTForms choices iterators have recently changed to expect a tuple of
4 elements. This change provides a callable field get_render_kw which
is similar to get_pk and get_label.

Note: blank form values have no obj reference, so it doesn't make
sense to call get_render_kw in that scope. For now an empty dict
is returned, but maybe it should provide a blank_render_kw
callable? That's a bit of a design decision that's not up to me.

I've had a quick look at fixing up the unit tests to make them pass, but
nothing substantial has been added to test the get_render_kw return
values.

setup.cfg Outdated Show resolved Hide resolved
@azmeuk
Copy link
Member

azmeuk commented Oct 23, 2023

LGTM. Can you add a changelog entry and fix the style CI job please?

Note: blank form values have no obj reference, so it doesn't make
sense to call get_render_kw in that scope. For now an empty dict
is returned, but maybe it should provide a blank_render_kw
callable? That's a bit of a design decision that's not up to me.

Let's do it simple for now, and wait to see if someone ever need a more complexe feature.

@ghost
Copy link
Author

ghost commented Oct 24, 2023

Style fixed. Thanks again.

@jace

This comment was marked as off-topic.

@ghost
Copy link
Author

ghost commented Nov 1, 2023

@jace All good from me, just waiting on someone to merge it.

@azmeuk azmeuk merged commit 08a9ad8 into pallets-eco:master Nov 1, 2023
8 checks passed
@pallets-eco pallets-eco deleted a comment from jace Nov 2, 2023
@jace
Copy link
Contributor

jace commented Nov 6, 2023

Folks, there's no PyPI release yet. Why was that comment deleted? It affects everyone using wtforms-sqlalchemy with the latest release of wtforms.

@ghost
Copy link
Author

ghost commented Nov 6, 2023

@jace Not sure. I'm not associated with the maintainers, sorry.

@jace
Copy link
Contributor

jace commented Nov 6, 2023

I just noticed WTForms 3.1.1 has been released, making render_kw optional (in pallets-eco/wtforms#816). The existing release on PyPI should continue to work. I've opened #45 to remove the pin on sqlalchemy<2.

@azmeuk
Copy link
Member

azmeuk commented Nov 6, 2023

I was waiting on conflicts on #44 being addressed before cutting a new release.
wtforms 3.1.1 restores the compatibility, but with a deprecation warning.

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