def parse_operators(args):
""" Avoid problem that mongoengine for some reason the operators
gte, gt, lt, lte doesn't work with dates in isoformat
"""
args = {k: v for k, v in args.items() if k not in ['skip', 'limit']}
for k, v in args.items():
try:
is_data = iso8601.parse_date(v)
except:
is_data = False
if is_data:
args[k] = is_data if is_data else v
return args
评论列表
文章目录