예제 #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))
예제 #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))
예제 #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))
예제 #4
0
파일: audit.py 프로젝트: ben12345/tally-ho
    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))
예제 #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)))
예제 #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))
예제 #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))
예제 #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'))
예제 #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))
예제 #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))
예제 #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'))
예제 #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))
예제 #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))
예제 #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'))
예제 #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'))
예제 #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))
예제 #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))
예제 #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']})))
예제 #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']])))
예제 #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})))
예제 #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)))
예제 #22
0
    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))
예제 #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']})))
예제 #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']})))
예제 #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']
                                                           ])))
예제 #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']})))
예제 #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})))
예제 #28
0
파일: audit.py 프로젝트: onaio/tally-ho
    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))
예제 #29
0
파일: clearance.py 프로젝트: sm2x/tally-ho
    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))
예제 #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))
예제 #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))
예제 #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))
예제 #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))