Hi,

I've some difficulty with config.add_route :

* I would like to match : "/edit.html" and "/.*/edit.html

Actually, I do that :

    config.add_route(
        "edit_page", "{traverse}/edit.html",
        traverse="{traverse}"
    )
    config.add_view(
        edit_page_view,
        route_name="edit_page",
        context=Resource,
        renderer="edit_page.tmpl"
    )
    config.add_route(
        "root_edit_page", "/edit.html",
        traverse="/"
    )
    config.add_view(
        root_edit_page_view,
        route_name="root_edit_page",
        context=Resource,
        renderer="edit_page.tmpl"
    )

This work but I think it's not clean.

I would like to do that :

    config.add_route(
        "edit_page", "{traverse:.*}/edit.html",
        traverse="{traverse}"
    )
    config.add_view(
        edit_page_view,
        route_name="edit_page",
        context=Resource,
        renderer="edit_page.tmpl"
    )

But {traverse:.*} don't match empty string.

How can I fix it ?

Regards,
Stephane

--
Stéphane Klein <[email protected]>
blog: http://stephane-klein.info
Twitter: http://twitter.com/klein_stephane
pro: http://www.is-webdesign.com

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