Is there any way to JSON serialize the search result (=Response object) and return as response of my Restful Django viewset endpoint? Since Response and Result objects' are invalidated JSON representation of objects (in __repr__ method) by adding some extra strings, it says Response object is not JSON serializable.
You can use the to_dict method on those objects to get the raw dictionary that is json serializable.
Most helpful comment
You can use the
to_dictmethod on those objects to get the raw dictionary that is json serializable.