def get_range_time(self):
import datetime
now = datetime.datetime.now()
# start = datetime.timedelta(hours=47, minutes=59, seconds=59)
start = now + datetime.timedelta(days=-2)
return start
def _get_packageinfo(self):
start = self.get_range_time()
status = Statemg.objects.get(name="SUCCESS")
packagemg_obj = PackageMg.objects.filter((Q(online="UNDO") | Q(online="")) & Q(status=status) & Q(create_datetime__gt=start))
这样写通过create_datetime 字段还是搜不到对应的数据,求指点?