I'm trying to combine Routes's RESTful actions with numbered
resources.  So I have the following URLs:

/section/1234                   # View incident 1234, with the usual
URL suffixes for REST actions.
/section/1234/5678         # View entry 5678 from incident 1234, with
REST actions.

/section/incident/1234 should redirect to the vew incident page.
/section/entry/1234 should redirect to the view entry page.  (Yes,
entry IDs are globally unique.)

The reason for all this is it's convenient for the user to see both
IDs in the URL and to have short URLs, but also allow the user to
access an entry without knowing the incident ID.

Route names should be "incident_view" etc, with just plain "incident"
for the view page.

Going the other way would also be acceptable, with /incident/1234 and
/entry/1234 being the REST actions and /1234/5678 being secondary
routes to them, as long as it can be accomplished without external
redirects (user visible) or full subrequests (cluttering the access
log).  Is it possible to do an internal redirect; e.g., for one route
to change the variables and then let it match another route?

routes/mapper.py lists some arguments to Mapper.resource that look
like they might do the trick but I'm having trouble putting it all
together.  I'm using the development version of Routes (with .dynamic
etc methods).  Is this all doable or am I asking for too much?

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

Reply via email to