filters.py 文件源码

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

项目:YouPBX 作者: JoneXiong 项目源码 文件源码
def lookups(self, request, admin_view):
        now = timezone.now()
        if now.tzinfo is not None:
            current_tz = timezone.get_current_timezone()
            now = now.astimezone(current_tz)
            if hasattr(current_tz, 'normalize'):
                now = current_tz.normalize(now)

        today = now.date()  #now.replace(hour=0, minute=0, second=0, microsecond=0)
        tomorrow = today + datetime.timedelta(days=1)
        return (
            (_('??'), {}),
            (_('Today'), {
                self.lookup_since_name: str(today),
                self.lookup_until_name: str(tomorrow),
            }),
        )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号