@treeio_login_required
@handle_response_format
def report_filter_remove(request, report_id, field_name, filter_index, 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 write access to this Report")
 model = loads(report.model)
 field = model.get_field(field_name)
 field.filters.pop((int(filter_index) - 1))
 report.model = dumps(model)
 report.save()
 return HttpResponseRedirect(reverse('reports_report_edit', args=[int(report_id)]))

@ treeio_login_required @ handle_response_format def report_filter_remove ( request , report_id , field_name , filter_index , 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 write access to this Report" ) model = loads ( report . model ) field = model . get_field ( field_name ) field . filters . pop ( ( int ( filter_index ) - 1 ) ) report . model = dumps ( model ) report . save ( ) return HttpResponseRedirect ( reverse ( 'reports_report_edit' , args = [ int ( report_id ) ] ) )
remove a filter on a given field for a report .