def clear_cache_round(cls, round, action): round.clear_template_cache() invalidate_template_cache('rounds', round.tournament.id, None)
def clear_template_cache(self): invalidate_template_cache('rounds', self.tournament.id, self)
def clear_cache_competitor(cls, competitor, action): competitor.tournament.clear_ranking_cache() invalidate_template_cache('info', competitor.tournament.id)
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)
def clear_cache_tournament(cls, tournament, action): tournament.clear_ranking_cache() invalidate_template_cache('info', tournament.id)
def clear_ranking_cache(self): cache.delete(self._get_ranking_cache_key()) invalidate_template_cache('players', self.id)