mitsuhiko/flask — pull request #1093 by caspervg (2014-06-18 19:55:50+00:00)
Title: Add runtime parameter functionality to url_for

I recently had some trouble with trying to add dynamic parameters (at runtime) using url_for, because it requires specific method parameters. This is especially useful if you want to set additional HTTP GET parameters easily.

I decided to go for a dict-based approach, where the _runtime parameter for the url_for method would inject a few extra url_for parameters at runtime.

### Included
* Changes to url_for to add this functionality
* Testcase for this functionality

### Usecase
I needed a way to generate URLs to endpoints with additional GET parameters based on the current page's GET parameters. More specifically, for paginated search results (where the search query is a GET parameter).

With this change, you can use the following:
```python
url_for('search', page=page, _runtime=request.args.to_dict())
```
instead of having to resort to ugly hacks or extra libraries to append the runtime parameters to the generated URL.