-
-
Notifications
You must be signed in to change notification settings - Fork 191
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
Fixed compatibility with Flask
's built-in url type-converters
#146
Fixed compatibility with Flask
's built-in url type-converters
#146
Conversation
…ction arg_url_for
…odel to render_table. Added ability to supply url parameters to render_table by allowing passage of a list (first item is the route namespace, second item is a list of tuples mapping variables to placeholders representing fields present in the model)
… placeholders representing fields of a model.
I know I still need to update the docs, but just wanted to float this out there first for your inputs @greyli @michaelbukachi |
Flask
's built-in url_converters
Flask
's built-in url type-converters
Thanks for working on this! I'm preparing a presentation and don't have time to review it right now. I will take care of it at the beginning of the next month. |
Nice work @caffeinatedMike! Don't you think it would be better to pass in a |
Thanks @michaelbukachi! Just happy to be able to help/contribute. Good point! I'll make it a point to adjust it to accept a query, update the tests, and update the documentation once I get the chance over the next couple days. Is there anything specific I need to do to the documentation in order for things to render correctly? I noticed my addition of the |
@caffeinatedMike Which file is not rendering properly? |
@michaelbukachi The |
The docs issue has been fixed in ab48a6c. |
@greyli @michaelbukachi Changes made to accept query in place of model. Tests, docs, and changelog updated to reflect and all tests are passing. |
Merged, thanks! |
Closes #136
Closes #145
With the addition of the
model
parameter to therender_table
macro we can now utilize the previously private macroarg_url_for
(previously_arg_url_for
) to correctly grab values from each record as it's iterated over during table rendering. This allows users to utilize the built-in werkzeug converters with their url parameters.Designed with backwards compatibility in mind. Users will still be able to pass in normal
url_for
calls as well. But, anything involving placeholders would be subject to the new tuple approach.