Hi,

I have a resource tree and I'm using traversal and named views.
However, I'd also like to support an /api/ namespace with different
views. So:

http://example.org/foo would traverse from the root to the resource
foo and render the default (unnamed) view for context=Foo

but

http://example.org/api/foo would traverse to foo and render a JSON
representation of foo, using a different view

I thought I could do this with hybrid routes, e.g:

config.add_route('api', '/api/*traverse', factory=Root)

I have a view for context=Root with route_name='api', and it is
rendered, but whenever I try to traverse further, e.g. to '/api/foo',
I get a 404. Moreover, I need some way to distinguish e.g. the unnamed
view on /foo from the unnamed view on /api/foo.

What is the best way to do this?

Martin

-- 
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