File “/home/python/Desktop/DjangoRESTframework/meiduo_mall/bookhero/views.py”, line 35, in get b...

个人分类: bug

关于在DjangoRESTframework中调用序列化对象属性的问题

File “/home/python/Desktop/DjangoRESTframework/meiduo_mall/bookhero/views.py”, line 35, in get

book_dick = book.data()

TypeError: ‘ReturnList’ object is not callable

在使用序列化器当中,book.data是调用的data属性,只需将data后面的括号去掉即可

你可能感兴趣的:(File “/home/python/Desktop/DjangoRESTframework/meiduo_mall/bookhero/views.py”, line 35, in get b...)