本文整理汇总了Python中models.Task.gql方法的典型用法代码示例。如果您正苦于以下问题:Python Task.gql方法的具体用法?Python Task.gql怎么用?Python Task.gql使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Task
的用法示例。
在下文中一共展示了Task.gql方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: task_process
# 需要导入模块: from models import Task [as 别名]
# 或者: from models.Task import gql [as 别名]
def task_process():
query = Task.gql("WHERE expire = :1 ORDER BY created_at", None)
task_ref = None
task_more = None
for fake_task_ref in query.fetch(1):
task_ref = task_get(fake_task_ref.action, fake_task_ref.action_id)
if not task_ref:
raise exceptions.ApiNoTasks
method_ref = PublicApi.get_method(task_ref.action)
rv = method_ref(*task_ref.args, **task_ref.kw)
task_remove(task_ref.action, task_ref.action_id)
query = Task.gql("WHERE expire < :1", datetime.utcnow())
t_ref = query.fetch(1)
if t_ref:
task_more = True
return task_more
示例2: read
# 需要导入模块: from models import Task [as 别名]
# 或者: from models.Task import gql [as 别名]
def read(referrer):
"""List all tasks"""
q=Task.gql("WHERE referrer = :1 ORDER BY created", referrer)
tasks = []
for task in q:
tasks.append({'id' : task.key().id(), 'todo' : task.todo, 'accomplished' : task.accomplished})
return current_app.response_class(json.dumps(tasks, indent=None if request.is_xhr else 2), mimetype='application/json')
示例3: relo_task
# 需要导入模块: from models import Task [as 别名]
# 或者: from models.Task import gql [as 别名]
def relo_task():
q=Task.gql("WHERE referrer = :1 ORDER BY created", 'http://gap.samdeha.com/tbd/')
for task in q:
task.referrer='http://gap.samdeha.com/tbd'
task.put()
return 'task relocated'