Я не могу отправить целочисленное поле в django Rest Framework? TypeError 'BoundField' object is not iterable
вот мой views.py
class ClinicList(ListCreateAPIView):
serializer_class=CliniDetailcSerializer
permission_classes=[IsAuthenticatedOrReadOnly]
def get_queryset(self):
qs=Clinic.objects.all().order_by('-id')
return qs
def post(self,request,format=None):
if request.user.is_authenticated and request.user.profile.type == 'doctor':
serializer = CliniDetailcSerializer(data=request.data)
if serializer.is_valid():
print(serializer.data.values())
Clinic.objects.create(doctor=request.user.profile,name=serializer["name"],price=serializer.data["price"],days=serializer["days"],start_time=serializer["start_time"],end_time=serializer["end_time"])
context={"data":serializer.data,"message":"clinic added successffullt"}
return Response(serializer.data)
else:
return Response({"message": "invalid data"})
else:
return Response({"message": "your are not a doctor"})
и я получил эту ошибку при отправке: 'BoundField' object is not iterable