2👍
✅
Because you are not actually serializing Zoo objects, but Animal objects. Piston sees that you have a queryset of Animals, and tries to find an Animal handler – not finding one, it just serializes all the built-in objects, but not the custom method.
Define an AnimalHandler
class and move the fields
tuple to there, and it should work.
Source:stackexchange.com