DEV Community

Discussion on: My personal django rest framework serializer notes

Collapse
 
damm89 profile image
damm89

I like your notes but I want to express my concern for code readability and mental overhead when (ab)using the methods that override serializer behavior (self.to_representation and self.to_internal_value) for the functionality (such as ....count()) that should be taken care of by the serializer fields or even object itself. Although the example provided works, this should be handled before the self.to_representation method is called.

Collapse
 
abdenasser profile image
Nasser El Idrissi

I totally agree with you on that, I'll update them to a better example use case!