Is it possible to pass query parameters via Django's {% url %} template tag?
No, because the GET parameters are not part of the URL.
Simply add them to the end:
<a href="{% url myview %}?office=foobar">
For Django 1.5+
<a href="{% url 'myview' %}?office=foobar">
A way to mix-up current parameters with new one:
{% url 'order_list' %}?office=foobar&{{ request.GET.urlencode }}
Modify your settings to have request variable:
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS as TCP
TEMPLATE_CONTEXT_PROCESSORS = TCP + (
'django.core.context_processors.request',
)
Use urlencode
if the argument is a variable
<a href="{% url 'myview' %}?office={{ some_var | urlencode }}">
or else special characters like spaces might break your URL.
Documentation: https://docs.djangoproject.com/en/3.0/ref/templates/builtins/#urlencode