Jaymon / endpoints

Lightweight REST api backend framework that automatically maps urls to python modules and classes
MIT License
29 stars 10 forks source link

decorators should support classes also #62

Closed Jaymon closed 7 years ago

Jaymon commented 7 years ago

It would be cool if we could cascade things like param:


@param("foo")
class Default(Controller):
    def GET(self, foo): pass
    def POST(self, foo): pass

so both GET and POST would inherit foo from the class.

Jaymon commented 7 years ago

So the problem is most of the decorators require the params that are being passed to the controller method, though there are ones that only need the request instance, the problem is you would have to know which ones can be put on class and which ones can't, that seems annoying to me and it doesn't seem worth the confusion.