.. 생략
class View(APIView):
def get(self, request):
notices = NoticeModel.objects.all()
notice_serializer = NoticeSerializer(data=notices).data
return Response(notice_serializer)
Original exception text was: 'QuerySet' object has no attribute 'title'.
[django] Serializer에 분명히 해당 필드가 있는데 없다고 하는 경우
.. 생략
class View(APIView):
def get(self, request):
notices = NoticeModel.objects.all()
notice_serializer = NoticeSerializer(data=notices).data
return Response(notice_serializer, many=True)