Beispiel #1
0
    def get(self, *args, **kwargs):
        form_list = audit()

        forms = paging(form_list, self.request)

        return self.render_to_response(self.get_context_data(
            forms=forms))
Beispiel #2
0
    def get(self, *args, **kwargs):
        user_is_clerk = is_clerk(self.request.user)
        form_list = forms_for_user(user_is_clerk)
        forms = paging(form_list, self.request)

        return self.render_to_response(
            self.get_context_data(forms=forms, is_clerk=user_is_clerk))
Beispiel #3
0
    def get(self, *args, **kwargs):
        form_list = ResultForm.objects.exclude(
            form_state=FormState.UNSUBMITTED)

        forms = paging(form_list, self.request)

        return self.render_to_response(self.get_context_data(forms=forms))
Beispiel #4
0
    def get(self, *args, **kwargs):
        user_is_clerk = is_clerk(self.request.user)
        form_list = forms_for_user(user_is_clerk)
        forms = paging(form_list, self.request)

        return self.render_to_response(self.get_context_data(
            forms=forms, is_clerk=user_is_clerk))
Beispiel #5
0
    def get(self, *args, **kwargs):
        form_list = ResultForm.objects.filter(form_state=FormState.CLEARANCE)
        forms = paging(form_list, self.request)

        return self.render_to_response(
            self.get_context_data(forms=forms,
                                  is_clerk=is_clerk(self.request.user)))
Beispiel #6
0
    def get(self, *args, **kwargs):
        all_checks = QuarantineCheck.objects.all().order_by('id')

        checks = paging(all_checks, self.request)

        return self.render_to_response(self.get_context_data(
            checks=checks))
Beispiel #7
0
    def get(self, *args, **kwargs):
        all_checks = QuarantineCheck.objects.all().order_by('id')

        checks = paging(all_checks, self.request)

        return self.render_to_response(self.get_context_data(
            checks=checks))
Beispiel #8
0
    def get(self, *args, **kwargs):
        # check cache
        candidate_list = Candidate.objects.all()
        candidates = paging(candidate_list, self.request)

        return self.render_to_response(
            self.get_context_data(candidates=candidates,
                                  remote_url='candidate-list-data'))
Beispiel #9
0
    def get(self, *args, **kwargs):
        form_list = ResultForm.objects.exclude(
            form_state=FormState.UNSUBMITTED)

        forms = paging(form_list, self.request)

        return self.render_to_response(self.get_context_data(
            forms=forms))
Beispiel #10
0
    def get(self, *args, **kwargs):
        tally_id = kwargs.get('tally_id')
        form_list = ResultForm.objects.filter(form_state=FormState.CLEARANCE, tally__id=tally_id)
        forms = paging(form_list, self.request)

        return self.render_to_response(self.get_context_data(
            forms=forms, is_clerk=is_clerk(self.request.user),
            tally_id=tally_id))
Beispiel #11
0
    def get(self, *args, **kwargs):
        # check cache
        tally_list = Tally.objects.all()
        tallies = paging(tally_list, self.request)

        return self.render_to_response(self.get_context_data(
            tallies=tallies,
            remote_url='tally-list-data'))
Beispiel #12
0
    def get(self, *args, **kwargs):
        tally_id = kwargs.get('tally_id')
        form_list = get_results_duplicates(tally_id)

        forms = paging(form_list, self.request)

        return self.render_to_response(
            self.get_context_data(forms=forms, tally_id=tally_id))
Beispiel #13
0
    def get(self, *args, **kwargs):
        tally_id = kwargs.get('tally_id')
        ballots = self.get_per_ballot_progress()

        ballots = paging(ballots, self.request)

        return self.render_to_response(
            self.get_context_data(ballots=ballots, tally_id=tally_id))
Beispiel #14
0
    def get(self, *args, **kwargs):
        # check cache
        station_list = Station.objects.all()
        stations = paging(station_list, self.request)

        return self.render_to_response(self.get_context_data(
            stations=stations,
            remote_url='center-list-data'))
Beispiel #15
0
    def get(self, *args, **kwargs):
        # check cache
        station_list = Station.objects.all()
        stations = paging(station_list, self.request)

        return self.render_to_response(
            self.get_context_data(stations=stations,
                                  remote_url='center-list-data'))
Beispiel #16
0
    def get(self, *args, **kwargs):
        tally_id = kwargs.get('tally_id')
        ballots = self.get_per_ballot_progress()

        ballots = paging(ballots, self.request)

        return self.render_to_response(
            self.get_context_data(
                ballots=ballots, tally_id=tally_id))
Beispiel #17
0
    def get(self, *args, **kwargs):
        tally_id = kwargs.get('tally_id')
        form_list = get_results_duplicates(tally_id)

        forms = paging(form_list, self.request)

        return self.render_to_response(
                self.get_context_data(forms=forms,
                    tally_id=tally_id))
Beispiel #18
0
    def get(self, *args, **kwargs):
        form_list = ResultForm.objects.exclude(
            form_state=FormState.UNSUBMITTED)

        forms = paging(form_list, self.request)

        return self.render_to_response(self.get_context_data(
            forms=forms,
            tally_id=kwargs['tally_id'],
            remote_url=reverse('form-progress-data', kwargs={'tally_id': kwargs['tally_id']})))
Beispiel #19
0
    def get(self, *args, **kwargs):
        tally_id = kwargs.get('tally_id')
        form_list = audit(tally_id)

        forms = paging(form_list, self.request)

        return self.render_to_response(self.get_context_data(
            forms=forms,
            tally_id=tally_id,
            remote_url=reverse('form-audit-data', args=[kwargs['tally_id']])))
Beispiel #20
0
    def get(self, *args, **kwargs):
        tally_id = kwargs.get('tally_id')
        form_list = clearance(tally_id)

        forms = paging(form_list, self.request)

        return self.render_to_response(self.get_context_data(
            forms=forms,
            tally_id=tally_id,
            remote_url=reverse('form-clearance-data', kwargs={'tally_id': tally_id})))
Beispiel #21
0
    def get(self, *args, **kwargs):
        form_list = ResultForm.objects
        if is_clerk(self.request.user):
            form_list = form_list.filter(form_state=FormState.CLEARANCE)
        else:
            form_list = form_list.filter(Q(form_state=FormState.CLEARANCE) |
                                         Q(form_state=FormState.CLEARANCE_PENDING_STATE))
        forms = paging(form_list, self.request)

        return self.render_to_response(self.get_context_data(
            forms=forms, is_clerk=is_clerk(self.request.user)))
    def get(self, *args, **kwargs):
        # check cache
        tally_id = kwargs['tally_id']

        candidate_list = Candidate.objects.filter(tally__id=tally_id)
        candidates = paging(candidate_list, self.request)

        return self.render_to_response(self.get_context_data(
            candidates=candidates,
            remote_url=reverse('candidate-list-data', kwargs={'tally_id': tally_id}),
            tally_id=tally_id))
Beispiel #23
0
    def get(self, *args, **kwargs):
        tally_id = kwargs.get('tally_id')
        form_list = duplicates(tally_id)

        forms = paging(form_list, self.request)

        return self.render_to_response(self.get_context_data(
            forms=forms,
            tally_id=tally_id,
            remote_url=reverse('form-duplicates-data',
                kwargs={'tally_id': kwargs['tally_id']})))
Beispiel #24
0
    def get(self, *args, **kwargs):
        tally_id = kwargs.get('tally_id')
        form_list = duplicates(tally_id)

        forms = paging(form_list, self.request)

        return self.render_to_response(
            self.get_context_data(
                forms=forms,
                tally_id=tally_id,
                remote_url=reverse('form-duplicates-data',
                                   kwargs={'tally_id': kwargs['tally_id']})))
Beispiel #25
0
    def get(self, *args, **kwargs):
        tally_id = kwargs.get('tally_id')
        form_list = audit(tally_id)

        forms = paging(form_list, self.request)

        return self.render_to_response(
            self.get_context_data(forms=forms,
                                  tally_id=tally_id,
                                  remote_url=reverse('form-audit-data',
                                                     args=[kwargs['tally_id']
                                                           ])))
Beispiel #26
0
    def get(self, *args, **kwargs):
        form_list = ResultForm.objects.exclude(
            form_state=FormState.UNSUBMITTED)

        forms = paging(form_list, self.request)

        return self.render_to_response(
            self.get_context_data(
                forms=forms,
                tally_id=kwargs['tally_id'],
                remote_url=reverse('form-progress-data',
                                   kwargs={'tally_id': kwargs['tally_id']})))
Beispiel #27
0
    def get(self, *args, **kwargs):
        tally_id = kwargs.get('tally_id')
        form_list = clearance(tally_id)

        forms = paging(form_list, self.request)

        return self.render_to_response(
            self.get_context_data(forms=forms,
                                  tally_id=tally_id,
                                  remote_url=reverse(
                                      'form-clearance-data',
                                      kwargs={'tally_id': tally_id})))
Beispiel #28
0
    def get(self, *args, **kwargs):
        format_ = kwargs.get('format')
        tally_id = kwargs.get('tally_id')
        user_is_clerk = is_clerk(self.request.user)
        form_list = forms_for_user(user_is_clerk, tally_id)

        if format_ == 'csv':
            return render_to_csv_response(form_list)

        forms = paging(form_list, self.request)

        return self.render_to_response(self.get_context_data(
            forms=forms, is_clerk=user_is_clerk,
            tally_id=tally_id))
Beispiel #29
0
    def get(self, *args, **kwargs):
        format_ = kwargs.get('format')
        tally_id = kwargs.get('tally_id')
        form_list = ResultForm.objects.filter(form_state=FormState.CLEARANCE,
                                              tally__id=tally_id)

        if format_ == 'csv':
            return render_to_csv_response(form_list)

        forms = paging(form_list, self.request)

        return self.render_to_response(
            self.get_context_data(forms=forms,
                                  is_clerk=is_clerk(self.request.user),
                                  tally_id=tally_id))
Beispiel #30
0
    def get(self, *args, **kwargs):
        format_ = kwargs.get('format')
        tally_id = kwargs.get('tally_id')
        user_is_clerk = is_clerk(self.request.user)
        form_list = forms_for_user(user_is_clerk, tally_id)

        if format_ == 'csv':
            return render_to_csv_response(form_list)

        forms = paging(form_list, self.request)

        return self.render_to_response(
            self.get_context_data(forms=forms,
                                  is_clerk=user_is_clerk,
                                  tally_id=tally_id))
Beispiel #31
0
    def get(self, *args, **kwargs):
        tally_id = kwargs.get('tally_id')
        format_ = kwargs.get('format')

        if format_ and format_ == 'csv':
            station_list = Station.objects.filter(center__tally__id=tally_id)

            station_list = station_list.values(
                'center__office__name',
                'sub_constituency__code',
                'center__name',
                'center__code',
                'station_number',
                'gender',
                'registrants',
                'percent_received',
                'percent_archived',
            ).order_by('center__code')

            header_map = {
                'center__office__name': 'office name',
                'sub_constituency__code': 'subconstituency code',
                'center__name': 'center name',
                'center__code': 'center code',
            }

            return render_to_csv_response(station_list,
                                          filename='centers_and_station',
                                          append_datestamp=True,
                                          field_header_map=header_map)

        # check cache
        station_list = Station.objects.filter(center__tally__id=tally_id)
        stations = paging(station_list, self.request)

        return self.render_to_response(
            self.get_context_data(stations=stations,
                                  remote_url=reverse('center-list-data',
                                                     kwargs=kwargs),
                                  tally_id=tally_id))
Beispiel #32
0
    def get(self, *args, **kwargs):
        form_list = duplicates()

        forms = paging(form_list, self.request)

        return self.render_to_response(self.get_context_data(forms=forms))
Beispiel #33
0
    def get(self, *args, **kwargs):
        form_list = get_results_duplicates()

        forms = paging(form_list, self.request)

        return self.render_to_response(self.get_context_data(forms=forms))