def as_sql(self, compiler, connection):
# Cast to date rather than truncate to date.
lhs, lhs_params = compiler.compile(self.lhs)
tzname = timezone.get_current_timezone_name() if settings.USE_TZ else None
sql, tz_params = connection.ops.datetime_cast_time_sql(lhs, tzname)
lhs_params.extend(tz_params)
return sql, lhs_params
评论列表
文章目录