[Fixed]-How to export ONLY selected records in django admin?

1đź‘Ť

I think the problem is your “opts = self.model._meta”. When I export to csv using a custom admin action, I use this: opts = queryset.model._meta, and the admin queryset does the limiting for me. The structure of your code is very different from mine so I don’t know how you need to get the equivalent to the “queryset”, but I think that is what is missing or not functioning correctly.

👤Sandra

Leave a comment