On Sun, May 24, 2009 at 1:41 PM, c <[email protected]> wrote:
>
> hello everyone!
>
> i'm new to pylons and routes and i'd encountered a problem trying to
> configure routes to my needs.
> i'd like to have admin panel section in my site (with subsections like
> overall settings, gallery settings etc.), and wanted an urls too look
> like that:
>
> www.example.com/panel/overall/save - that would trigger action save of
> controller panel_gallery
> www.example.com/panel/gallery/add - that would trigger action add of
> controller panel_gallery
>
> after reading routes manual I wasn't able to come up with a solution
> i'd be grateful for any suggestions

I assume the middle component is what you want to save or add, and
that the action will know what to do with it.

map.connect("panel", "/panel/{what}/{action}",
    controller="panel_gallery")

def  save(self, what):

def add(self, what):

You'll have to see how Pylons capitalizes controller names with "_" in
them.  I'd assume "Panel_galleryController'.

Note that this route will match any 3-component URL starting with
"/panel", including any that you may have intended for other routes.
As always, put the most specific routes first.

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