django-commons / drf-excel

An XLSX spreadsheet renderer for Django REST Framework.
BSD 3-Clause "New" or "Revised" License
217 stars 40 forks source link

Feature request: configurable file name #39

Closed Bercof closed 2 years ago

Bercof commented 3 years ago

As a user I want to get returned file based on my request. For example, I whant to return file name based on request path:

That is pretty easy to do: add to XLSXFileMixin.get_filename method parameters (self, request, *args, **kwargs) and pass them from finalize_response method. Thus developer may override XLSXFileMixin with correct file name getter based on request processing.

willtho89 commented 2 years ago

@Bercof i have implemented your suggestion. Its in the release 0.4.3