本文整理汇总了Python中models.Match.all方法的典型用法代码示例。如果您正苦于以下问题:Python Match.all方法的具体用法?Python Match.all怎么用?Python Match.all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Match
的用法示例。
在下文中一共展示了Match.all方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from models import Match [as 别名]
# 或者: from models.Match import all [as 别名]
def get(self):
#500 is max delete at once limit.
db.delete(Match.all().fetch(500))
match_count = Match.all().count()
template_values = {
'match_count': match_count,
}
path = os.path.join(os.path.dirname(__file__), '../templates/matches/flush.html')
self.response.out.write(template.render(path, template_values))
示例2: get
# 需要导入模块: from models import Match [as 别名]
# 或者: from models.Match import all [as 别名]
def get(self):
logging.info( "#1 admin, settings. " )
matches = Match.all()
self.render(u'admin',
matches = matches)
示例3: get
# 需要导入模块: from models import Match [as 别名]
# 或者: from models.Match import all [as 别名]
def get(self, name):
c = Club.get_by_key_name(name)
if c is None:
self.response.set_status(404)
t = JINJA2_ENV.get_template('404.html')
self.response.out.write(t.render({}))
return
cal = CalendarWrap(c.display)
q = Match.all().filter('home = ', c)
for match in q:
cal.add(match)
q = Match.all().filter('away = ', c)
for match in q:
cal.add(match)
self.response.headers["Content-Type"] = "text/calendar; charset=utf-8"
self.response.out.write(cal.to_string())
示例4: getCurrentMatchByUser
# 需要导入模块: from models import Match [as 别名]
# 或者: from models.Match import all [as 别名]
def getCurrentMatchByUser(current_user_id):
#Gets the match the user is currently participating in, or None if no match started.
#TODO: Check & Confirm creation order
hackathon = Match.all().filter("users =", current_user_id).order("-created").get()
if not hackathon or (100 in hackathon.outcome): #Most recent is nonexistant or completed
return None
return hackathon
示例5: get
# 需要导入模块: from models import Match [as 别名]
# 或者: from models.Match import all [as 别名]
def get(self):
matches = Match.all().order('event').fetch(100)
template_values = {
"matches": matches,
}
path = os.path.join(os.path.dirname(__file__), '../templates/matches/list.html')
self.response.out.write(template.render(path, template_values))
示例6: get
# 需要导入模块: from models import Match [as 别名]
# 或者: from models.Match import all [as 别名]
def get(self):
match_count = Match.all().count()
template_values = {
"match_count": match_count
}
path = os.path.join(os.path.dirname(__file__), '../../templates/admin/matches/dashboard.html')
self.response.out.write(template.render(path, template_values))
示例7: get
# 需要导入模块: from models import Match [as 别名]
# 或者: from models.Match import all [as 别名]
def get(self):
# check for a cached version
# --------------------------------------------------------------------#
if self.emit(self.response.out):
return
# not cached or evicted from cache; regenerate
# --------------------------------------------------------------------#
matches_data = []
for match in Match.all().filter("processed =", True).order("-created").fetch(10):
matches_data.append(MatchData(match, show_href=True))
# render and update
# --------------------------------------------------------------------#
recent_matches = misc.render("recent_matches.html", locals())
self.update(recent_matches)
self.response.out.write(recent_matches)
示例8: get
# 需要导入模块: from models import Match [as 别名]
# 或者: from models.Match import all [as 别名]
def get(self):
for h in Hacker.all().fetch(1000):
h.delete()
for m in Match.all().fetch(1000):
m.delete()
self.response.out.write("Datastore cleared of matches & hackers");