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.
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.
I totally agree with you on that, I'll update them to a better example use case!