3 ms·
Yeah same here. It has the cleanest mapping from REST resources to Python class + method. It just made sense to me: The router block at the top plus: clas
by rdtsc 12y ago
Yeah same here. It has the cleanest mapping from REST resources to Python class + method. It just made sense to me:
The router block at the top plus:
class MyResource:
def GET(self,...): ...
def POST(self,...): ...
def PUT(self,...): ...
def DELETE(self,...): ...
Looks really nice. Haven't tried serving or rendering templates from it, so never tested that code.
- tiglionabbit 12y agoCheck out Flask's MethodView
- rdtsc 12y agoOh Cool. Hadn't seen that before. I like MethodView dispatch pattern.
- euphemize 12y agoFWIW, many other python web frameworks use the very same pattern.