本文整理汇总了Python中Core.maps.Updates.week_tick方法的典型用法代码示例。如果您正苦于以下问题:Python Updates.week_tick方法的具体用法?Python Updates.week_tick怎么用?Python Updates.week_tick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Core.maps.Updates
的用法示例。
在下文中一共展示了Updates.week_tick方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: execute
# 需要导入模块: from Core.maps import Updates [as 别名]
# 或者: from Core.maps.Updates import week_tick [as 别名]
def execute(self, request, user, x, y, z, fleets=False):
week = Updates.week_tick()
planet = Planet.load(x,y,z)
if planet is None:
return HttpResponseRedirect(reverse("planet_ranks"))
Q = session.query(FleetScan, Planet, Alliance)
Q = Q.join(FleetScan.target)
Q = Q.outerjoin(Planet.intel).outerjoin(Intel.alliance)
Q = Q.filter(FleetScan.owner == planet)
Q = Q.order_by(desc(FleetScan.landing_tick))
if not fleets:
Q = Q.filter(FleetScan.landing_tick >= week)
outgoing = Q.all()
Q = session.query(FleetScan, Planet, Alliance)
Q = Q.join(FleetScan.owner)
Q = Q.outerjoin(Planet.intel).outerjoin(Intel.alliance)
Q = Q.filter(FleetScan.target == planet)
Q = Q.order_by(desc(FleetScan.landing_tick))
if not fleets:
Q = Q.filter(FleetScan.landing_tick >= week)
incoming = Q.all()
scan = planet.scan("A") or planet.scan("U")
return render("iplanet.tpl", request, planet=planet, scan=scan, outgoing=outgoing, incoming=incoming)