On Fri, Sep 25, 2009 at 4:39 PM, Jon Collette <[email protected]> wrote:
> I'm using the RestController which generates a map.resources route:
>
> map.resource('message', 'message', controller='api/message',
> path_prefix='/api', name_prefix='api_')
>
> This works great for GET calls: /api/message OR /api/message/$message_id
>
> I would like to use the url: /api/message/$message_id/$offset
>
> I can't figure out how to retrieve another value from my route.
map.resource creates very specific URLs. I don't think there's a way
to add components on the right without reimplementing the method.
You can add additional routes for them:
map.resource(... same as above ...)
map.connect("api_message_with_offset", "/api/message/{id}/{offset}",
controller="api/message", action="show")
def show(self, id, offset=None, format="html")
You can add additional GET routes with the method; e.g.,
/api/message/2/ask_delete , but that's only for a few fixed values,
not for an arbitrary offset.
--
Mike Orr <[email protected]>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---