django restframework APIView怎么写接口?put接口请求
废话不多说,直接上代码:
class BookFilterView(APIView):
def put(self,request,nid):
book_obj = Book.objects.get(id=nid)
validated_data = BookSerialize(data=request.data,instance=book_obj)
...
原创
2019-08-21 17:29:11 ·
1465 阅读 ·
0 评论