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

:list renderer in klein.Plating should support dictionaries, and fill slots with their values #161

Open
glyph opened this issue Jan 6, 2017 · 0 comments
Labels

Comments

@glyph
Copy link
Member

glyph commented Jan 6, 2017

Use-case: we have a list of things which have a display name, an interesting attribute, and an internal ID. We want to render something like <tr><td><a href="id">display name</a></td><td>interesting attribute</td></tr> for each one - a pretty standard list view.

Problem: right now each element in the list is just filled as the item slot, which means in order to accomplish this we need to build a separate widget.

Suggested solution: if klein encounters a dict, instead of doing fillSlots(item=_extra_types(item)), it should do fillSlots(**item); then the template for the list can be self-contained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants