---------- Forwarded message ---------- From: Date: Feb 27, 2023 11:49 AM Subject: Getting 4 four latest objects from django model To: <django-users@googlegroups.com> Cc:
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/CAGQoQ3xyv3eEvgMQsTAO%3DXQtSsQo2XazBtKaHHxPFJ0-pvD%3DZg%40mail.gmail.com.