Thanks but it returned an error that,

'ActionGame' is not subcriptabe

Do you have a way of solving this typerror?

On Feb 27, 2023 11:55 AM, "Muhammad Juwaini Abdul Rahman" <juwa...@gmail.com>
wrote:

> latest_action= [ActionGame.objects.filter (os='windows',
> category='action').latest ('published_date')[:4]]
>
>
> On Mon, 27 Feb 2023 at 16:52, Byansi Samuel <samuelbyans...@gmail.com>
> wrote:
>
>> I got a problem with my queryset. Am trying to get 4 latest objects from
>> my model but it returns  1 objects  the top latest.
>>
>> Below is my code. Any support and guidance is appreciated.
>>
>> #action/views.py
>>
>> from  Action.models import ActionGame
>>
>> latest_action= [ActionGame.objects.filter (os='windows',
>> category='action').latest ('published_date')][:4]
>>
>> Buy the problem is that it returns 1 object yet l need 4 objects
>>
>> What  can I do to solve it?
>>
>> --
>> 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 django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/
>> msgid/django-users/CAGQoQ3yN19LF0s2y-tiMYyyXuRnxfFA_UuCo6982_
>> XpNpuCKRg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAGQoQ3yN19LF0s2y-tiMYyyXuRnxfFA_UuCo6982_XpNpuCKRg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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 django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAFKhtoS_Tsrz00iGCAb3OUNzGeR0b5AAQgyj6Z
> bHxgg8-taqeQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAFKhtoS_Tsrz00iGCAb3OUNzGeR0b5AAQgyj6ZbHxgg8-taqeQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGQoQ3yWPLWNq9xMHe_NrF-uaUY6JnvEiT_R_VwhvH_c3x1gmw%40mail.gmail.com.

Reply via email to