twisted / twisted/klein

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

Open
#161 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.