mjumbewu / django-rest-framework-csv

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

Data serialization customization #50

Closed davidmir closed 2 years ago

davidmir commented 8 years ago

Customize the data serialization (serialization the field by mapping them to a function) on CSVRenderer class. For example:

class MyUserRenderer (CSVRenderer):
      data_serializer_map = {'time': (lambda param: time + ' hour(s)')}
mjumbewu commented 8 years ago

Just getting around to looking at this -- sorry about that. I'm wondering why we might do this at the renderer level as opposed to, say, the serializer.