diff options
author | Tim Laszlo <tim.laszlo@gmail.com> | 2012-06-08 10:34:10 -0500 |
---|---|---|
committer | Tim Laszlo <tim.laszlo@gmail.com> | 2012-06-14 09:02:24 -0500 |
commit | 4f2e595e6649f036c306abf0400cf45ce352375b (patch) | |
tree | 67ef223bf3a35c62542cf5240119aa2a66379990 /src/lib/Bcfg2/Server/Reports/reports/views.py | |
parent | afc2236cb97bdfd00cd3d7c54669b52861266b03 (diff) | |
download | bcfg2-4f2e595e6649f036c306abf0400cf45ce352375b.tar.gz bcfg2-4f2e595e6649f036c306abf0400cf45ce352375b.tar.bz2 bcfg2-4f2e595e6649f036c306abf0400cf45ce352375b.zip |
web_reports: group filtering for <type> element views
Diffstat (limited to 'src/lib/Bcfg2/Server/Reports/reports/views.py')
-rw-r--r-- | src/lib/Bcfg2/Server/Reports/reports/views.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/Bcfg2/Server/Reports/reports/views.py b/src/lib/Bcfg2/Server/Reports/reports/views.py index 2dd811ca0..5d9a71285 100644 --- a/src/lib/Bcfg2/Server/Reports/reports/views.py +++ b/src/lib/Bcfg2/Server/Reports/reports/views.py @@ -14,6 +14,7 @@ from django.shortcuts import render_to_response, get_object_or_404 from django.core.urlresolvers import \ resolve, reverse, Resolver404, NoReverseMatch from django.db import connection +from django.db.models import Q from Bcfg2.Server.Reports.reports.models import * @@ -148,14 +149,15 @@ def config_item(request, pk, type="bad"): @timeview -def config_item_list(request, type, timestamp=None): +def config_item_list(request, type, timestamp=None, **kwargs): """Render a listing of affected elements""" mod_or_bad = type.lower() type = convert_entry_type_to_id(type) if type < 0: raise Http404 - current_clients = Interaction.objects.get_interaction_per_client_ids(timestamp) + current_clients = Interaction.objects.interaction_per_client(timestamp) + current_clients = [q['id'] for q in _handle_filters(current_clients, **kwargs).values('id')] ldata = list(Entries_interactions.objects.filter( interaction__in=current_clients, type=type).values()) |