Easiest way to serialize a simple class object with simplejson?

前端 未结 7 2005
萌比男神i
萌比男神i 2020-12-07 15:55

I\'m trying to serialize a list of python objects with JSON (using simplejson) and am getting the error that the object \"is not JSON serializable\".

The class is a

7条回答
  •  失恋的感觉
    2020-12-07 16:27

    If you are using Django, it can be easily done via Django's serializers module. More info can be found here: https://docs.djangoproject.com/en/dev/topics/serialization/

提交回复
热议问题