Created
May 14, 2013 14:14
-
-
Save mitsuhiko/5576231 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import request, url_for | |
def modified_url(**new_args): | |
args = request.view_args.copy() | |
args.update(new_args) | |
return url_for(request.endpoint, **args) | |
app.jinja_env.globals['modified_url'] = modified_url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="{{ modified_url(page=2) }}">link to page 2</a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
not work for current gets
can be okey