I want to get objects with the pk I send through request but I want only one item from the queryset.
I want BatchLog objects that their batch_id is same as the pk and my query returns multiple items within that query. I just want one of them and it doesn't matter which one it is.
def get_queryset(self):
return BatchLog.objects.filter(batch_id=self.kwargs["pk"])
It returns QuerySet<[BatchLog, BatchLog]> but I need QuerySet<BatchLog>
How can I achieve it?
Thanks.