L
L
lyntik2020-05-20 10:53:28
Django
lyntik, 2020-05-20 10:53:28

Why does the query not work with COUNT?

class ActiveDriverGetPassgersToSit(generics.ListAPIView):
serializer_class = ClientSerializers
queryset = ActivePassengers.objects.raw('SELECT COUNT(*) FROM public.client_activepassengers WHERE "idStop" = 1')

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alternativshik, 2020-05-20
@alternativshik

And what are you going to see here? There's an int and not a queryset.
PS what for there to write raw request generally moreover and such simple?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question