1 2 3 4 5 6 7 8 9 10 11 12 | @register.simple_tag(takes_context=True)
def url_add_query(context, **kwargs):
request = context.get('request')
get = request.GET.copy()
get.update(kwargs)
path = '%s?' % request.path
for query, val in get.items():
path += '%s=%s&' % (query, val)
return path[:-1]
|
More like this
- Digg-like pagination by SmileyChris 3 years, 12 months ago
- Page numbers with ... like in Digg by Ciantic 4 years, 1 month ago
- Paginator TemplateTag by trbs 5 years, 1 month ago
- Improved many-page pagination by dokterbob 2 years, 8 months ago
- Pagination Alphabetically compatible with paginator_class by vascop 1 year, 1 month ago
Comments
Lovely, worked for me when I had filtered querysets with class base views:
#