我的问题是:
使用以下查询的如何获得现在到期的联系人()?在运行视图时未发送的所有联系人
Contact.objects.filter(send_email_on=<WHERE TIME NOW???? , status='not sent')请注意,我不希望将来的联系人不发送到现在()
发布于 2013-05-30 13:13:48
发布于 2013-05-30 13:16:37
好吧,你可以试试:
from datetime import datetime
# greater than or equal now(), change the __lte for whatever you need
Contact.objects.filter(send_email_on__lte=datetime.now(), status='not sent')您可以查看医生们,它对字段查找字符串非常有用。
提示:
https://stackoverflow.com/questions/16837036
复制相似问题