:list renderer in klein.Plating should support dictionaries, and fill slots with their values
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 838
- Forks
- 123
- Avg merge
- 7h 58m
- Merged PRs (30d)
- 12
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start from the :list renderer and the existing fillSlots(item=_extra_types(item)) behavior described in the issue. Update dictionary handling so its entries become template slots, then verify that a list template can render each item's display name, attribute, and ID without a separate widget.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, web-dev
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100