-1

i have a search field in my django app and filtering Data work well . when i want get csv report , whole of record will be print in csv not filtered data . thank you for help me .

    qs=EventkindofProblem.object.all()
    MyFilter=eventfilter(request.GET,queryset=qs)
    return djqscsv.render_to_csv_response(myFilter.qs,append_data_stamp=True)

1 Answers1

0

Checklist

  1. is the filtered result expected to be all()? then the filter is working normally. you should use arguments that can filter out the queryset.
  2. is the filtered result expected to be None? then you will need to override django-filter>-2.0.0's behavior, since django-filter (from 2.0.0) returns all if form is invalid or the filtered result is null. (how to override django-filter non-strict filtering: Prevent all data from being displayed with Django-filter)

it'd be helpful if you could provide more details about what you're trying to fix.

NamsanCode
  • 226
  • 1
  • 4