Hi,
I am making a queryset by slicing it to return only first 2 objects but
When I am using .last() on this queryset then it is not applying slicing
Pharmaceutical.objects.order_by('id').values('id')
>>> [{'id': 2L}, {'id': 3L}, {'id': 4L}, {'id': 5L}]
>>> Pharmaceutical.objects.order_by('id')[:2].values('id')
[{'id': 2L}, {'id': 3L}]
>>> Pharmaceutical.objects.order_by('id')[:2].values('id').last()
{'id': 5L} # But this should be 3
--
Thanks,
Regards
Shivam Jindal
+91 8586896112
--
You received this message because you are subscribed to the Google Groups
"Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/CAL6wZzm92j_aEzjSJim4j5u54fW9EGXEJovy5eCyedbFqzunkA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.