models.py 文件源码

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

项目:flow-dashboard 作者: onejgordon 项目源码 文件源码
def Current(user, which="all"):
        date = tools.local_time(user.get_timezone(), datetime.today())
        keys = []
        if which in ["all", "year"]:
            annual_id = ndb.Key('Goal', datetime.strftime(date, "%Y"), parent=user.key)
            keys.append(annual_id)
        if which in ["all", "month"]:
            monthly_id = ndb.Key('Goal', datetime.strftime(date, "%Y-%m"), parent=user.key)
            keys.append(monthly_id)
        if which in ["all", "longterm"]:
            longterm_id = ndb.Key('Goal', datetime.strftime(date, "longterm"), parent=user.key)
            keys.append(longterm_id)
        goals = ndb.get_multi(keys)
        return [g for g in goals]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号