Skip to content

Instantly share code, notes, and snippets.

@mitechie
Forked from mvantellingen/pyramid-routes.py
Last active December 11, 2015 03:38
Show Gist options
  • Select an option

  • Save mitechie/4539032 to your computer and use it in GitHub Desktop.

Select an option

Save mitechie/4539032 to your computer and use it in GitHub Desktop.

Revisions

  1. mitechie revised this gist Jan 15, 2013. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions pyramid-routes.py
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,8 @@
    @view_config(route_name='my-route')
    def my_view(request):
    # here i want to know if path-1 or path-2 was taken, preferably via a var n matchdict?

    if request.view_name = 'my-route2':
    # do extra work

    config.add_route('my-route', '/path-1/view')
    config.add_route('my-route', '/path-2/view')
    config.add_route('my-route2', '/path-2/view')
  2. @mvantellingen mvantellingen created this gist Jan 15, 2013.
    7 changes: 7 additions & 0 deletions pyramid-routes.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    @view_config(route_name='my-route')
    def my_view(request):
    # here i want to know if path-1 or path-2 was taken, preferably via a var n matchdict?


    config.add_route('my-route', '/path-1/view')
    config.add_route('my-route', '/path-2/view')