Python Eve - 如何按日期时间值过滤
Python Eve - How to filter by datetime value
如何 return 按日期或日期间隔筛选项目?
我正在根据 eve documentation:
的过滤示例尝试类似的操作
/records/?where={"date": {"$gte": "2016-10-17"}}
我在想这个 python 语法也可以通过检查 eve 的请求解析中的这个注释来工作 code:
/records/?where=date==datetime('2016-10-16')
但结果是500内部错误,可能是语法错误。我很难过
是时候做对了。
谢谢。
试试这个:
/records?where={"date": {"$gt": "Mon, 17 Oct 2016 03:00:00 GMT"}}
它使用默认为 RFC1123 的 DATE_FORMAT
设置。
如何 return 按日期或日期间隔筛选项目? 我正在根据 eve documentation:
的过滤示例尝试类似的操作/records/?where={"date": {"$gte": "2016-10-17"}}
我在想这个 python 语法也可以通过检查 eve 的请求解析中的这个注释来工作 code:
/records/?where=date==datetime('2016-10-16')
但结果是500内部错误,可能是语法错误。我很难过 是时候做对了。
谢谢。
试试这个:
/records?where={"date": {"$gt": "Mon, 17 Oct 2016 03:00:00 GMT"}}
它使用默认为 RFC1123 的 DATE_FORMAT
设置。