Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

django queryset last 10

last_ten = Messages.objects.filter(since=since).order_by('-id')[:10]
last_ten_in_ascending_order = reversed(last_ten)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #django #queryset
ADD COMMENT
Topic
Name
1+7 =