I want to download my data as a csv file.
My problem is that I can’t get my filters applyed in the downloaded csv, it’ll always give me the whole list.
I tried to connect the two functions but it doesn’t work as expected. But they both run fine on their own.
Does anyone know how to achieve that? Or knows what I’m doing wrong?
# filters.py
class InstitutionFilter(django_filters.FilterSet):
name = CharFilter(field_name="name", lookup_expr="icontains")
class Meta:
model = Institution
fields = "__all__"
this is the url. And with the ‘normal’ download this works fine. Do I need to redirect to the path("institutions", search_institution, name="institutions") from my stakeholders app? How can I pass the parameter of the query?
I’m sorry, I meant to ask for the actual URL that you use in the browser to request this page. It should look something like http://example.com/export?name=Ken.
I don’t understand what you’re trying to do here. I asked for the url you’re using and you show me a url with a path of export, but this example you just posted appears to be for something different.