【发布时间】:2013-05-10 23:53:31
【问题描述】:
我正在尝试在某个时间之前或某个时间将所有帖子放在一个线程中。那么如何让 Django 允许我输入自己的查询呢?
这是我使用 Django 的模型函数所能得出的最接近的结果。
# need to get all the post from Thread post_set that were created before Thread post_set 9
posts = Thread.post_set.filter(created <= Thread.post_set.all()[9].created)
【问题讨论】:
标签: python django django-models django-queryset django-permissions