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
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mitechie/4539032 to your computer and use it in GitHub Desktop.
Save mitechie/4539032 to your computer and use it in GitHub Desktop.
@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-route2', '/path-2/view')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment