📜  django 按日期过滤查询集 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:46.543000             🧑  作者: Mango

代码示例1
# gt - Greater than.
# gte - Greater than or equal to.
# lt - Less than.
# lte - Less than or equal to.

import datetime
samples = Sample.objects.filter(sampledate__gte=datetime.date(2011, 1, 1),
                                sampledate__lte=datetime.date(2011, 1, 31))