【发布时间】:2017-03-21 06:07:58
【问题描述】:
我想让我的查询集返回给定间隔内的一些对象,例如从位置 26 到位置 30 ,我的查询集只需要在 27 ,28 , 29 个位置上有 3 个元素。我的代码:
object_query_set = Comment.objects.filter(id_chat=id_chat).order_by('-date')[:26-30]
【问题讨论】:
标签: python django list django-queryset