I am writing a small CMS in pylons.
Below you can find a snippet of my routing.py
map.connect('content', '/cmsprefix/{mode}/{lang}/*url_obj',
controller='rdc', action='execute', mode='view', lang='nl')
map.connect( '/cmsprefix/{mode}/{lang}/', controller='rdc',
mode='view', action='execute', lang='nl', url_obj='')
map.connect('/cmsprefix/', controller='rdc', mode='view',
lang='nl',
action='execute', url_obj='home')
cmsprefix identifies the cms part ofd the webapplication
rdc is the name of the controller that handles all content related
urls
mode defines wether the user is in view mode or in edit
lang defines the language, the site being multilingual
url_obj is mapped to the object in the content hierarchy and looks
like
/rootobject/child/child/.../child/objectAction?params
the rdc controller strats like this
class RdcController(BaseController):
def execute(self, url_obj, mode, lang):
....
in the rdc controller I am parsing url_obj to get the right
objectAction on the right
object in the content hierarchy
Hope this might give you an idea
Ruben
On Aug 17, 12:38 am, mickgardner <[email protected]> wrote:
> Thanks Ben, and Mike, for your replies. I like the idea of using
> routes, mainly because its more familiar and middleware is a bit of a
> black box to me still.
> I think at this point i'll set up a test and see if i can get it
> working then come back here if I have any problems. You've given me
> enough to go on, which is great.
>
> Thanks guys.
>
> 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
-~----------~----~----~----~------~----~------~--~---