示例#1
0
文件: models.py 项目: 0101/sctms
 def clear_cache_round(cls, round, action):
     round.clear_template_cache()
     invalidate_template_cache('rounds', round.tournament.id, None)
示例#2
0
文件: models.py 项目: 0101/sctms
 def clear_template_cache(self):
     invalidate_template_cache('rounds', self.tournament.id, self)
示例#3
0
文件: models.py 项目: 0101/sctms
 def clear_cache_competitor(cls, competitor, action):
     competitor.tournament.clear_ranking_cache()
     invalidate_template_cache('info', competitor.tournament.id)
示例#4
0
文件: models.py 项目: 0101/sctms
 def clear_cache_rules(cls, rules, action):
     ids = (Tournament.objects.filter(format_class=rules.format_class)
            .values_list('id'))
     if ids:
         for id in zip(*ids)[0]:
             invalidate_template_cache('info', id)
示例#5
0
文件: models.py 项目: 0101/sctms
 def clear_cache_tournament(cls, tournament, action):
     tournament.clear_ranking_cache()
     invalidate_template_cache('info', tournament.id)
示例#6
0
文件: models.py 项目: 0101/sctms
 def clear_ranking_cache(self):
     cache.delete(self._get_ranking_cache_key())
     invalidate_template_cache('players', self.id)