On Thu, Aug 4, 2022 at 6:21 AM Luciano Martins <[email protected]> wrote:
>
> É  annotate
> Publisher.objects.annotate(below_5=below_5).annotate(above_5=above_5)
> Em quarta-feira, 3 de agosto de 2022 às 19:31:18 UTC-3, 
> [email protected] escreveu:
>>
>> Bom dia amigos, estou desenvolvendo um blog e me deparei com um erro em uma 
>> consulta, vou mandar o trecho do codigo onde esta o erro:
>>
>>     def get_queryset(self):
>>         qs = super().get_queryset()
>>         qs = qs.order_by('-id')
>>         qs = qs.annotade(
>>             numero_comentarios=Count(
>>                 Case(
>>                     When(Comentario__publicado_comentario=True, then=1)
>>                 )
>>             )
>>         )
>>
>>         return qs
>>
>> Esse e o erro no terminal:
>>
>> AttributeError: 'QuerySet' object has no attribute 'annotade'
>
annotade is not the same as annotate
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/bb9c8102-c7d8-4ec3-9fed-5e78aa84b13en%40googlegroups.com.



-- 
Joel Goldstick

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPM-O%2ByXpNc5cB7VYQsTKPsN3RrUXHzzwhFoKBm9tJ2sRCDKBQ%40mail.gmail.com.

Reply via email to