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()
Exemple #2
0
    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()
Exemple #3
0
    def handle_round(self, round, **options):
        if options["clean"]:
            self.stdout.write(
                self.style.WARNING("Deleting all ballot sets for {}...".format(
                    round.name)))
            delete_all_ballotsubs_for_round(round)

        try:
            if options["num_ballots"] is not None:
                self.stdout.write(
                    self.style.MIGRATE_HEADING(
                        "Generating ballot sets for {:d} randomly-chosen debates "
                        "in {}...".format(options["num_ballots"], round.name)))
                add_results_to_round_partial(round, options["num_ballots"],
                                             **self.result_kwargs(options))
            else:
                self.stdout.write(
                    self.style.MIGRATE_HEADING(
                        "Generating ballot sets for all debates in {}...".
                        format(round.name)))
                add_results_to_round(round, **self.result_kwargs(options))

        except ValueError as e:
            raise CommandError(e)
        except DebateAdjudicator.DoesNotExist as e:
            raise CommandError(
                str(e) +
                " (Have you done adjudicator allocations for this round?)")
Exemple #4
0
    def handle_round(self, round, **options):
        if options["clean"]:
            self.stdout.write(self.style.WARNING("Deleting all ballot sets for {}...".format(round.name)))
            delete_all_ballotsubs_for_round(round)

        try:
            if options["num_ballots"] is not None:
                self.stdout.write(self.style.MIGRATE_HEADING(
                    "Generating ballot sets for {:d} randomly-chosen debates "
                    "in {}...".format(options["num_ballots"], round.name)))
                add_results_to_round_partial(round, options["num_ballots"], **self.result_kwargs(options))
            else:
                self.stdout.write(self.style.MIGRATE_HEADING(
                    "Generating ballot sets for all debates in {}...".format(round.name)))
                add_results_to_round(round, **self.result_kwargs(options))

        except ValueError as e:
            raise CommandError(e)
        except DebateAdjudicator.DoesNotExist as e:
            raise CommandError(str(e) + " (Have you done adjudicator allocations for this round?)")