我尝试将旧的orm查询格式化为更短的orm查询。
旧(工作):
statistics_q_start = statistics_q.filter(
Statistics.pulled_data_at >= earliest_time + start_date,
Statistics.pulled_data_at <= latest_time + start_date)
新(错误):
statistics_q_start = statistics_q.filter(
earliest_time + start_date >=
Statistics.pulled_data_at
<= latest_time + start_date)
当我尝试新查询时,出现错误:("Boolean value of this clause is not defined")
我尝试新的查询,因为我刚才得到一个pep8建议,我应该执行这样的查询。