Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turnout report by Geographic areas - Centers #426

Open
10 tasks
lincmba opened this issue Oct 5, 2023 · 0 comments
Open
10 tasks

Turnout report by Geographic areas - Centers #426

lincmba opened this issue Oct 5, 2023 · 0 comments
Assignees

Comments

@lincmba
Copy link
Contributor

lincmba commented Oct 5, 2023

The turnout report is used for displaying the current voter turnout per administrative area. Administrative areas currently being displayed are Regions, Offices, Constituencies and Sub Constituencies on separate tabs on the Turnout Reports page.
There needs to be one for the Centers. It should be consistent with the documentation provided here https://docs.google.com/spreadsheets/d/1YnykTc6-MYjokM15VRmZcSWnBS-JESA1eTEhDEivVu8/edit#gid=1805275455
https://docs.google.com/document/d/151tS0rlJpywFSrLDmr-Gtmz6PSNApv_Vbz67IsWbdX8/edit#heading=h.jzokcajibbt

Implementation

  • Create a function that fetches all centers provided a tally_id in the turnout_reports_by_admin_areas.py file
def get_centers(tally_id):
    return Center.objects.filter(tally_id=tally_id).annotate(
        area_name=F("code")
        ).values("area_name", "id")
  • Update the following functions to include centers filters
    • get_stations_in_admin_area
    • get_result_forms_for_station_in_admin_area
    • get_station_votes_in_admin_area
  • Use the above function in the get_initial_queryset function in the TurnoutReportByAdminAreasDataView view
  • Add the tab to the as below to the turnout_report_by_admin_area.html file. Update the rest of the file accordingly to have the change
<li role="presentation" class="{% if admin_level == 'center' %} active {% endif %}">
<a href="{% url 'turnout-list' tally_id  'center' %}">Centers</a>
</li>
  • Add tests

Task check list


  • Create turnout reports for the pending reports:
    • Constituencies
    • Sub Constituencies
  • Enable navigating to the next page and back if the report has more than one page of records to show.
  • Enable page size changes.
  • Add total row as the last row in the reports.
  • Enable csv export.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants