Any extra keyword parameters passed to url_for() which are not supported by the route are automatically added as query parameters.
For repeated values, pass in a list:
<a href="https://stackoverflow.com/questions/23143827/{{ url_for("stats', chart=[new_chart, other_chart]) }}>View More</a>
Flask will then:
- find the
statsendpoint - fill in any required route parameters
- transform any remaining keyword parameters to a query string
Demo, with 'stats' being the endpoint name for /:
>>> url_for('stats', chart=['foo', 'bar'])
'/?chart=foo&chart=bar'