当前位置: 首页>>代码示例>>Python>>正文


Python Match.all方法代码示例

本文整理汇总了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))
开发者ID:Apple101Review,项目名称:the-blue-alliance,代码行数:14,代码来源:datafeed_controller.py

示例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)
开发者ID:phoenix24,项目名称:fb-apps,代码行数:9,代码来源:main.py

示例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())
开发者ID:skitazaki,项目名称:jleague-calendar,代码行数:18,代码来源:main.py

示例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
开发者ID:dillongrove,项目名称:TheHackers,代码行数:9,代码来源:main.py

示例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))
开发者ID:Apple101Review,项目名称:the-blue-alliance,代码行数:11,代码来源:match_controller.py

示例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))
开发者ID:Apple101Review,项目名称:the-blue-alliance,代码行数:11,代码来源:admin_match_controller.py

示例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)
开发者ID:krewlogic,项目名称:bb-oftl,代码行数:24,代码来源:recent_matches.py

示例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");
开发者ID:dillongrove,项目名称:TheHackers,代码行数:8,代码来源:main.py


注:本文中的models.Match.all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。