def handle_round(self, round, **options): self.stdout.write("Deleting all debates in round '{}'...".format( round.name)) Debate.objects.filter(round=round).delete() round.draw_status = Round.STATUS_NONE round.save() self.stdout.write( "Checking in all teams, adjudicators and venues for round '{}'...". format(round.name)) activate_all(round) self.stdout.write("Generating a draw for round '{}'...".format( round.name)) DrawManager(round).create() allocate_venues(round) round.draw_status = Round.STATUS_CONFIRMED round.save() self.stdout.write( "Auto-allocating adjudicators for round '{}'...".format( round.name)) if round.ballots_per_debate == 'per-adj': allocator_class = VotingHungarianAllocator else: allocator_class = ConsensusHungarianAllocator allocate_adjudicators(round, allocator_class) self.stdout.write("Generating results for round '{}'...".format( round.name)) add_results_to_round(round, **self.result_kwargs(options)) round.tournament.current_round = round round.tournament.save()
def setUp(self): super(RandomDrawTests, self).setUp() self.round = Round(tournament=self.tournament, seq=2, draw_type=Round.DRAW_RANDOM) self.round.save() activate_all(self.round)
def handle_round(self, round, **options): self.stdout.write("Deleting all debates in round '{}'...".format(round.name)) Debate.objects.filter(round=round).delete() round.draw_status = Round.STATUS_NONE round.save() self.stdout.write("Checking in all teams, adjudicators and venues for round '{}'...".format(round.name)) activate_all(round) self.stdout.write("Generating a draw for round '{}'...".format(round.name)) DrawManager(round).create() allocate_venues(round) round.draw_status = Round.STATUS_CONFIRMED round.save() self.stdout.write("Auto-allocating adjudicators for round '{}'...".format(round.name)) if round.ballots_per_debate == 'per-adj': allocator_class = VotingHungarianAllocator else: allocator_class = ConsensusHungarianAllocator allocate_adjudicators(round, allocator_class) self.stdout.write("Generating results for round '{}'...".format(round.name)) add_results_to_round(round, **self.result_kwargs(options)) round.tournament.current_round = round round.tournament.save()
def setUp(self): super(RandomDrawTests, self).setUp() self.round = Round(tournament=self.t, seq=2, draw_type=Round.DRAW_RANDOM) self.round.save() activate_all(self.round)