summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Laszlo <tim.laszlo@gmail.com>2012-10-18 11:18:48 -0500
committerTim Laszlo <tim.laszlo@gmail.com>2012-10-18 11:18:48 -0500
commit3f88b5cf78941579cc5151050160b0ca43e44827 (patch)
tree0ab95a11899322673c79b57f47239a0a8d425fbb
parent76480f472ed2e39a4b7b307e0e6cccfbfbc6f5f9 (diff)
downloadbcfg2-3f88b5cf78941579cc5151050160b0ca43e44827.tar.gz
bcfg2-3f88b5cf78941579cc5151050160b0ca43e44827.tar.bz2
bcfg2-3f88b5cf78941579cc5151050160b0ca43e44827.zip
add query string to filter removal
-rw-r--r--src/lib/Bcfg2/Reporting/templatetags/bcfg2_tags.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/Bcfg2/Reporting/templatetags/bcfg2_tags.py b/src/lib/Bcfg2/Reporting/templatetags/bcfg2_tags.py
index bb5a720d0..f5f2e7528 100644
--- a/src/lib/Bcfg2/Reporting/templatetags/bcfg2_tags.py
+++ b/src/lib/Bcfg2/Reporting/templatetags/bcfg2_tags.py
@@ -119,6 +119,11 @@ def filter_navigator(context):
if 'page_limit' in kwargs:
del kwargs['page_limit']
+ # get a query string
+ qs = context['request'].GET.urlencode()
+ if qs:
+ qs = '?' + qs
+
filters = []
for filter in filter_list:
if filter == 'group':
@@ -127,7 +132,7 @@ def filter_navigator(context):
myargs = kwargs.copy()
del myargs[filter]
filters.append((filter,
- reverse(view, args=args, kwargs=myargs)))
+ reverse(view, args=args, kwargs=myargs) + qs))
filters.sort(lambda x, y: cmp(x[0], y[0]))
myargs = kwargs.copy()
@@ -135,10 +140,10 @@ def filter_navigator(context):
if 'group' in myargs:
del myargs['group']
selected=False
- groups = [('---', reverse(view, args=args, kwargs=myargs), selected)]
+ groups = [('---', reverse(view, args=args, kwargs=myargs) + qs, selected)]
for group in Group.objects.values('name'):
myargs['group'] = group['name']
- groups.append((group['name'], reverse(view, args=args, kwargs=myargs),
+ groups.append((group['name'], reverse(view, args=args, kwargs=myargs) + qs,
group['name'] == kwargs.get('group', '')))
return {'filters': filters, 'groups': groups}