klein
klein copied to clipboard
☂ general awesomeness for klein.Plating
Here are some things that should be added to klein.Plating to make it really complete, which were left out of the initial implementation (#118) to keep it compact:
- [ ] Support for different types of templates
- [ ] the ones from twisted;
XMLFile#121 - [ ] and
XMLStringas implied by #89's basic prototype #122 - [ ] HTML5Lib #123
- [ ] the ones from twisted;
- [ ] Deferred support #131
- [ ] including some kind of solution for asynchronous JSON serialization #124
- [ ] More documentation, particularly for how to use widgets #125
- [ ] Something on the input side, for conveniently parsing JSON post bodies and handling form data submission - something that doesn't involve handling state in memory, by the way, since that doesn't scale. (Is there even a way in werkzeug's routing syntax to extract a query arg as a python parameter, or doe sit only accept path segments?) #126
- [ ]
attr.ssupport - specifically, automatically invokingasdictso applications can work entirely in terms of nice data structures and not manually decompose things into dicts and lists #127 - [ ] pluggable renderer support. the example even has a great use-case: latitude and longitude are conventionally presented as "east" and "west", "north" and "south", not positive and negative numbers. We may want to present an individual serializable value in a different way. I think that the way to do this might be
@plating.renderer("blub") def blubrender(plated_data, request, tag): "..."to stuff things into a specific renderer's element. Still not sure how to do composition / renderer libraries nicely, but at the very least you could write a function and then doadd_utility_renderers(my_plating)#128 and #130 - closely related, possibly resolvable with the same implementation - [ ] datetime serialization (what even is the best practice for this in JSON) #129
- [ ] real content-type negotiation #132
- [ ] support for methods #133 (oops)
- [ ] allow for nesting within
:listrenderer #161
Perhaps this ticket should be a milestone instead?