Feature #201
Use PJE's AddOns for tracking resource-ful-ness
| Status: | New | Start: | 2008-11-13 | |
| Priority: | Normal | Due date: | ||
| Assigned to: | - | % Done: | 0% |
|
| Category: | - | |||
| Target version: | - | |||
Description
http://pypi.python.org/pypi/AddOns
AddOns would probably remove a bit of boilerplater code from restish but how much I'm not really sure.
The main advantage would be that any old object could become a resource by simply annotating a method with a resource decorator:
class Person(object):
@resource.GET()
def html(self, request):
return "<p>I'm a person.</p>"
I think AddOns would also allow restish to support run time (i.e. not class def time) resource setup.
def person_html(person, request):
return "<p>I'm a person.</p>"
person = get_a_person()
Resource(person).add('GET, person_html)
Not sure how useful that really is though.