Bom dia meu amigo muito obrigado pela ajuda, foi um erro muito óbvio mas é
isso mesmo, valeu pela ajuda! comunidade foda!

Em qui., 4 de ago. de 2022 às 07:34, Joel Goldstick <
[email protected]> escreveu:

> 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
> .
>

-- 
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/CA%2BMVKRq2CPr__adY11KH%2BX_zrN2Bxazzg%3Dywaw3BZqVigZwEjQ%40mail.gmail.com.

Reply via email to