performance improvement

apikeys
Laurent 4 months ago
parent b00e01a674
commit 0a6b4614fe
  1. 4
      tournaments/models/round.py

@ -55,8 +55,10 @@ class Round(TournamentSubModel):
return name
def ranking_matches(self, hide_empty_matches):
children_with_matches = self.children.prefetch_related('matches')
matches = []
for child in self.children.all():
for child in children_with_matches:
child_matches = child.matches.all()
if hide_empty_matches:

Loading…
Cancel
Save