其他分享
首页 > 其他分享> > 当打印反序列化对象时报错:AssertionError: When a serializer is passed a `data` keyword argument you must call `.i

当打印反序列化对象时报错:AssertionError: When a serializer is passed a `data` keyword argument you must call `.i

作者:互联网

AssertionError: When a serializer is passed a `data` keyword argument you must call `.is_valid()` before attempting to access the serialized `.data` representation.
You should either call `.is_valid()` first, or access `.initial_data` instead.

报错原因是:

 

 解决办法:

  只要不要打印ser.data即可

标签:AssertionError,When,argument,access,valid,call,序列化,data
来源: https://www.cnblogs.com/Mr-fang/p/16386671.html