@treeio_login_required
@handle_response_format
def report_filter(request, report_id, field_name, response_format='html'):
 report = get_object_or_404(Report, pk=report_id)
 if (not request.user.profile.has_permission(report, mode='w')):
  return user_denied(request, message="You don't have access to this Report")
 if request.POST:
  FilterForm(request.user.profile, request.POST, report=report, field_name=field_name).save()
  return HttpResponseRedirect(reverse('reports_report_edit', args=[report.id]))
 else:
  form = FilterForm(request.user.profile, report=report, field_name=field_name)
 return render_to_response('reports/report_filter', {'form': form, 'field_name': field_name}, context_instance=RequestContext(request), response_format=response_format)

@ treeio_login_required @ handle_response_format def report_filter ( request , report_id , field_name , response_format = 'html' ) : report = get_object_or_404 ( Report , pk = report_id ) if ( not request . user . profile . has_permission ( report , mode = 'w' ) ) : return user_denied ( request , message = "You don't have access to this Report" ) if request . POST : FilterForm ( request . user . profile , request . POST , report = report , field_name = field_name ) . save ( ) return HttpResponseRedirect ( reverse ( 'reports_report_edit' , args = [ report . id ] ) ) else : form = FilterForm ( request . user . profile , report = report , field_name = field_name ) return render_to_response ( 'reports/report_filter' , { 'form' : form , 'field_name' : field_name } , context_instance = RequestContext ( request ) , response_format = response_format )
view to filter over a given field for a report .