I am trying to filter Objects in django for a query set instead of a single value. Please see my code below
@api_view(['GET'])
def getOffersReceived(request, name):
owner = Profile.objects.get(name=name)
dogs = Dog.objects.filter(owner=owner)
print(dogs)
sittings = Sitting.objects.filter(dog=dogs)
return Response()
The print(dogs) line is showing a query set of 4 values. The next step I am trying to get all the sittings that have value dog matching either one of the items in the query set.
I am getting the following error:
ValueError: The QuerySet value for an exact lookup must be limited to one result using slicing.
any help would be greatly appreciated.
Thank you