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

Add `get_filename` method #14

Closed notanumber closed 5 years ago

notanumber commented 5 years ago

Would it make sense to mirror how most of the DRF & Django's CBVs work by having a get_ method for get_filename that would allow a user to dynamically set the filename when using the XLSXFileMixin?

Maybe as simple as:

def get_filename(self):
    return self.filename
FlipperPA commented 5 years ago

Great idea! Can you give this branch a whirl and see if it works for ya?

https://github.com/wharton/drf-renderer-xlsx/tree/feature/get-filename-method

FlipperPA commented 5 years ago

BTW, you are @notanumber, you are a free man! 🔢

FlipperPA commented 5 years ago

This has been published to PyPI as version 0.3.5.

notanumber commented 5 years ago

Looks good, thanks! I'll upgrade and give it a whirl shortly.