我在使用 pusher 传递对象时遇到问题,它给了我一个错误Error: new_action is not JSON serializable
。我试过了json.dumps(new_action)
,但还是不行。这是我的代码:
视图.py:
new_action = Action(actor=actor, verb=verb, action_object=action_object,description=description, target=target)
new_action.save()
p['stream_' + str(actor.username)].trigger('liveStream', {
'new_action': new_action,
});
return new_action