No problem. I feel obligated to mention however that pyramid_handlers works
fine for this case as well. You can decorate multiple methods with the same
"name" but different predicates. For example:

class MyHandler(object):
    def __init__(self, request):
        self.request = request

    @action(name='endpoint', request_method='GET', renderer='string')
    def GET_endpoint(self):
        return 'this is a GET request'

    @action(name='endpoint', request_method='GET',
                 request_param='fmt=json', renderer='json')
    def GET_endpoint_for_json(self):
        return {'key': 'value'}

config.add_handler('api', '/foo/{action}', handler=MyHandler)

/foo/endpoint -> 'this is a GET request'
/foo/endpoint?fmt=json -> '{"key":"value"}'

-- 

Michael

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to