def search_details(request, search_id): logging.info("djrs.view.search_details") harness = getWebHarness() if harness.is_connected() is False: return HttpResponseRedirect(reverse('djrs_login')) template_vars = {} try: (req_id, msg_id) = harness.request_search_list(int(search_id)) resp = harness.specific_response(req_id) if resp: (resp_id, resp_msg) = resp dict_msg = protobuf_to_dict(resp_msg) template_vars['search_list'] = search_searchlist(dict_msg['searches']) except Exception, e: logging.info("Unexpected Exception: %s" % (e))
# invalid form will return errors. pass else: form = SearchForm() # An unbound form template_vars['form'] = form # now grab existing search results. try: limit = 500 (req_id, msg_id) = harness.request_search_list(None, limit) resp = harness.specific_response(req_id) if resp: (resp_id, resp_msg) = resp dict_msg = protobuf_to_dict(resp_msg) template_vars['search_list'] = search_searchlist(dict_msg['searches']) except Exception, e: logging.info("Unexpected Exception: %s" % (e)) return render_to_response('djrs_search.dtml', template_vars, context_instance=RequestContext(request)) def search_details(request, search_id): logging.info("djrs.view.search_details") harness = getWebHarness() if harness.is_connected() is False: return HttpResponseRedirect(reverse('djrs_login')) template_vars = {}
form = SearchForm() # An unbound form template_vars['form'] = form # now grab existing search results. try: limit = 500 (req_id, msg_id) = harness.request_search_list(None, limit) resp = harness.specific_response(req_id) if resp: (resp_id, resp_msg) = resp dict_msg = protobuf_to_dict(resp_msg) # If array is empty, entry does not appear at all if 'searches' in dict_msg: template_vars['search_list'] = \ search_searchlist(dict_msg['searches']) except Exception, e: logging.info("Unexpected Exception: %s" % (e)) return render_to_response('djrs_search.dtml', template_vars, context_instance=RequestContext(request)) def search_details(request, search_id): logging.info("djrs.view.search_details") harness = getWebHarness() if harness.is_connected() is False: return HttpResponseRedirect(reverse('djrs_login')) template_vars = {}