Ejemplo n.º 1
0
    def generate_result_docs(self, lang):
        from zeus.results_report import build_doc

        results_name = self.election.name
        score = self.election.election_module == "score"
        parties = self.election.election_module == "parties"
        poll = self.poll
        build_doc(
            _(u"Results"),
            self.election.name,
            self.election.institution.name,
            self.election.voting_starts_at,
            self.election.voting_ends_at,
            self.election.voting_extended_until,
            [
                (
                    poll.name,
                    poll.zeus.get_results(),
                    poll.questions_data,
                    poll.questions[0]["answers"],
                    poll.voters.all(),
                )
            ],
            lang,
            self.get_poll_result_file_path("pdf", "pdf", lang[0]),
            score=score,
            parties=parties,
        )
Ejemplo n.º 2
0
    def generate_election_result_docs(self, lang):
        from zeus.results_report import build_doc

        pdfpath = self.get_election_result_file_path("pdf", "pdf", lang[0])
        polls_data = []
        score = self.election.election_module == "score"
        parties = self.election.election_module == "parties"

        for poll in self.election.polls.filter():
            polls_data.append(
                (
                    poll.name,
                    poll.zeus.get_results(),
                    poll.questions_data,
                    poll.questions[0]["answers"],
                    poll.voters.all(),
                )
            )

        build_doc(
            _(u"Results"),
            self.election.name,
            self.election.institution.name,
            self.election.voting_starts_at,
            self.election.voting_ends_at,
            self.election.voting_extended_until,
            polls_data,
            lang,
            pdfpath,
            score=score,
            parties=parties,
        )
Ejemplo n.º 3
0
 def generate_result_docs(self, lang):
     from zeus.results_report import build_doc
     score = self.election.election_module == "score"
     parties = self.election.election_module == "parties"
     poll = self.poll
     build_doc(_('Results'),
               self.election.name,
               self.election.institution.name,
               self.election.voting_starts_at,
               self.election.voting_ends_at,
               self.election.voting_extended_until,
               [(poll.name, poll.zeus.get_results(), poll.questions_data,
                 poll.questions[0]['answers'], poll.voters.all())],
               lang,
               self.get_poll_result_file_path('pdf', 'pdf', lang[0]),
               score=score,
               parties=parties)
Ejemplo n.º 4
0
    def generate_election_result_docs(self, lang):
        from zeus.results_report import build_doc
        pdfpath = self.get_election_result_file_path('pdf', 'pdf', lang[0])
        polls_data = []
        score = self.election.election_module == "score"
        parties = self.election.election_module == "parties"

        for poll in self.election.polls.filter():
            polls_data.append((poll.name, 
                               poll.zeus.get_results(),
                               poll.questions_data,
                               poll.questions[0]['answers'],
                               poll.voters.all()))

        build_doc(_(u'Results'), self.election.name, self.election.institution.name,
                self.election.voting_starts_at, self.election.voting_ends_at,
                self.election.voting_extended_until,
                polls_data,
                lang,
                pdfpath, score=score, parties=parties)