adminActions.py 文件源码

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

项目:flow-dashboard 作者: onejgordon 项目源码 文件源码
def get(self, d):
        # Run after admin user logs in
        u = User.query().get()
        if u:
            today = datetime.today()
            g = Goal.CreateMonthly(u, date=today)
            g.Update(text=["Get it done"])
            g2 = Goal.Create(u, str(today.year))
            g2.Update(text=["Make progress"])
            ndb.put_multi([g, g2])
            h = Habit.Create(u)
            h.Update(name="Run")
            h.put()
            p = Project.Create(u)
            p.Update(title="Blog post", subhead="How Flow works")
            p.put()

            Task.Create(u, "Get this done").put()

            t = Task.Create(u, "Think hard", due=datetime.today())
            t2 = Task.Create(u, "Think even harder", due=datetime.today())
            message = "OK"
        else:
            message = "No user"
        self.json_out({'message': message})
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号