def retrieve(self, request, pk=None):
queryset = UserProfile.objects.all()
if pk is not None:
profile = get_object_or_404(queryset, pk=pk)
else:
profile = UserProfile.objects.get(user=request.user)
serializer = UserSerializerProfile(profile)
return Response(serializer.data)
评论列表
文章目录