Skip to content Skip to sidebar Skip to footer

Object Of Type Leave Is Not Json Serializable

{i am unable to get how to resolve this problem.i am trying to save a dict buy creating a model instance but i am getting error due to the foreign key in my leave model which is c

Solution 1:

Error message suggests that you are trying to assign hostel_name as a string/CharField. As per your model, it needs to be a hostel_manager object.

Not sure what your POST serializer or payload looks like but you'd probably want to set the hostel_manager_pk field to the kund kund bhawan's object's PK.

Post a Comment for "Object Of Type Leave Is Not Json Serializable"