3

I have defined two serializers for a model, ListingSerializer and DetailedSerializer. Also, there is a static function get_people_count() defined in both serializers as below:

@staticmethod
def get_people_count(obj):
  #some code

When using Django Debug toolbar, get_people_count() of ListingSerializer is called instead of DetailedSerializer's even though DetailedSerializer is returned in overridden get_serializer_class(). However, this problem doesn't occur when using Postman. Debug toolbar is updated to 1.11 version, still this issue is occuring.

0 Answers0