Skip to content

Instantly share code, notes, and snippets.

@binarymatt
Forked from mitechie/pyramid-routes.py
Last active December 11, 2015 03:38
Show Gist options
  • Save binarymatt/4539099 to your computer and use it in GitHub Desktop.
Save binarymatt/4539099 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.matched_route.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