本文整理汇总了Python中Job.Job.select方法的典型用法代码示例。如果您正苦于以下问题:Python Job.select方法的具体用法?Python Job.select怎么用?Python Job.select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Job.Job
的用法示例。
在下文中一共展示了Job.select方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GET
# 需要导入模块: from Job import Job [as 别名]
# 或者: from Job.Job import select [as 别名]
def GET(self, name=None, version=None):
jobs = []
if version:
title = "%s %s" % (name, version)
package = "%s/%s" % (name, version)
query = Job.select(IN(Job.q.package,
Select(Package.q.id, AND(
Package.q.name==name,
Package.q.version==version))))
else:
title = package = name
query = Job.select(IN(Job.q.package,
Select(Package.q.id, Package.q.name==name)))
result, page, nb_pages = _paginate_query(query.orderBy(
DESC(Job.q.package)))
jobs.extend(result)
return render.base(page=render.tab(jobs=jobs, page=page, nb_pages=nb_pages), \
hostname=socket.gethostname(), \
title=title, \
package=package, \
archs=RebuilddConfig().arch, \
dists=RebuilddConfig().get('build', 'dists').split(' '))
示例2: GET
# 需要导入模块: from Job import Job [as 别名]
# 或者: from Job.Job import select [as 别名]
def GET(self, dist, arch=None):
jobs = []
jobs.extend(Job.select(sqlobject.AND(Job.q.arch == arch, Job.q.dist == dist),
orderBy=sqlobject.DESC(Job.q.creation_date))[:10])
return render.base(page=render.tab(jobs=jobs), \
arch=arch, \
dist=dist, \
title="%s/%s" % (dist, arch), \
hostname=socket.gethostname(), \
archs=RebuilddConfig().arch, \
dists=RebuilddConfig().get('build', 'dists').split(' '))