Re: Help with DRF error

2023-12-16 Thread Larry Martell
On Sat, Dec 16, 2023 at 1:10 PM Reddy Tintaya wrote: > Can't you just use > workitem = serializers.PrimaryKeyRelatedField( > queryset=WorkItem.objects.all()) > instead of workitem_id? > No because workitem_id is what is sent in the request. > > On Sat, Dec 16, 2023 at 10:00 AM Larry

Re: Help with DRF error

2023-12-16 Thread Reddy Tintaya
Can't you just use workitem = serializers.PrimaryKeyRelatedField( queryset=WorkItem.objects.all()) instead of workitem_id? On Sat, Dec 16, 2023 at 10:00 AM Larry Martell wrote: > I have a DRF API. It is throwing an error that I have not been able to fix. > > Here is my view and serializer:

Help with DRF error

2023-12-16 Thread Larry Martell
I have a DRF API. It is throwing an error that I have not been able to fix. Here is my view and serializer: class CreateNotations(CreateAPIView): permission_classes = [IsAuthenticated] serializer_class = NotationListSerializer def post(self, request, *args, **kwargs): return