def longterm(request, *args, **kwargs): db = pyfaf.storage.getDatabase() params = dict(request.REQUEST) params.update(kwargs) form = OsAssociateComponentFilterForm(db, params) ids = (r[0] for r in form.get_release_selection()) problems = query_longterm_problems(db, flatten(ids), form.get_component_selection()) problems = paginate(problems, request) forward = {'problems' : problems, 'form' : form} return render_to_response('problems/longterm.html', forward, context_instance=RequestContext(request))
def hot(request, *args, **kwargs): db = pyfaf.storage.getDatabase() params = dict(request.REQUEST) params.update(kwargs) form = OsAssociateComponentFilterForm(db, params) last_date = datetime.date.today() - datetime.timedelta(days=14) ids = (r[0] for r in form.get_release_selection()) problems = query_hot_problems(db, flatten(ids), form.get_component_selection(), last_date) problems = paginate(problems, request) forward = {'problems' : problems, 'form' : form} return render_to_response('problems/hot.html', forward, context_instance=RequestContext(request))