mjumbewu / django-rest-framework-csv

CSV Tools for Django REST Framework
BSD 2-Clause "Simplified" License
364 stars 89 forks source link

Column names from verbose names #14

Open aop opened 10 years ago

aop commented 10 years ago

Since Django provides Fields a verbose_name attribute, it would be nice if that could be specified as the column name. This messes up the flattening maybe though...

mjumbewu commented 10 years ago

Hey, yeah, this is a good idea. Using the model verbose names may be difficult though, since the data no longer has any connection to the models by the time it gets to the renderer.

More generally, it would be useful to be able to specify a mapping of column header overrides for the renderer. It wouldn't have to mess up the flattening. I don't have much time in the immediate future to look dive into this, but if you want to send a pull request, or just start a branch, I'll pop in as time permits.

fabienheureux commented 5 years ago

I know this is an old issue, but I used a workaround to tackle this:

This a far from perfect, but it does the job for now 😎