operations.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:LatinSounds_AppEnviaMail 作者: G3ek-aR 项目源码 文件源码
def adapt_datetimefield_value(self, value):
        if value is None:
            return None

        # Expression values are adapted by the database.
        if hasattr(value, 'resolve_expression'):
            return value

        # SQLite doesn't support tz-aware datetimes
        if timezone.is_aware(value):
            if settings.USE_TZ:
                value = timezone.make_naive(value, self.connection.timezone)
            else:
                raise ValueError("SQLite backend does not support timezone-aware datetimes when USE_TZ is False.")

        return six.text_type(value)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号