diff --git a/src/project_reports/filter.py b/src/project_reports/filter.py index c2f83653..8784b4d2 100644 --- a/src/project_reports/filter.py +++ b/src/project_reports/filter.py @@ -4,33 +4,34 @@ from rh.models import ActivityDomain, Cluster, Location, Organization from .models import ProjectMonthlyReport + class ReportFilterForm(django_filters.FilterSet): clusters = django_filters.ModelMultipleChoiceFilter( # field_name='test', # to_field_name='project', - queryset = Cluster.objects.all(), - widget=forms.SelectMultiple() + queryset=Cluster.objects.all(), + widget=forms.SelectMultiple(), ) organization = django_filters.ModelMultipleChoiceFilter( - queryset = Organization.objects.all(), + queryset=Organization.objects.all(), widget=forms.SelectMultiple(), ) activity_domains = django_filters.ModelChoiceFilter( - queryset = ActivityDomain.objects.all(), + queryset=ActivityDomain.objects.all(), widget=forms.SelectMultiple(), ) country = django_filters.ModelChoiceFilter( - queryset = Location.objects.filter(type="Country"), + queryset=Location.objects.filter(type="Country"), widget=forms.Select(), ) - province = django_filters.ModelChoiceFilter( - queryset = Location.objects.filter(type="Province"), - widget=forms.Select() - ), + province = ( + django_filters.ModelChoiceFilter(queryset=Location.objects.filter(type="Province"), widget=forms.Select()), + ) district = django_filters.ModelChoiceFilter( - queryset = Location.objects.filter(type="District"), + queryset=Location.objects.filter(type="District"), widget=forms.Select(), ) + class Meta: model = ProjectMonthlyReport - fields = "__all__" \ No newline at end of file + fields = "__all__" diff --git a/src/project_reports/migrations/0005_alter_activityplanreport_report_types.py b/src/project_reports/migrations/0005_alter_activityplanreport_report_types.py index 6fbd0c7c..ef14d901 100644 --- a/src/project_reports/migrations/0005_alter_activityplanreport_report_types.py +++ b/src/project_reports/migrations/0005_alter_activityplanreport_report_types.py @@ -4,16 +4,15 @@ class Migration(migrations.Migration): - dependencies = [ - ('rh', '0012_merge_20231220_0933'), - ('project_reports', '0004_activityplanreport_target_achieved'), + ("rh", "0012_merge_20231220_0933"), + ("project_reports", "0004_activityplanreport_target_achieved"), ] operations = [ migrations.AlterField( - model_name='activityplanreport', - name='report_types', - field=models.ManyToManyField(blank=True, to='rh.reporttype'), + model_name="activityplanreport", + name="report_types", + field=models.ManyToManyField(blank=True, to="rh.reporttype"), ), ] diff --git a/src/project_reports/views.py b/src/project_reports/views.py index c11b9f92..582ccf76 100644 --- a/src/project_reports/views.py +++ b/src/project_reports/views.py @@ -11,7 +11,8 @@ from django.urls import reverse from django.utils import timezone from django.views.decorators.cache import cache_control -from .filter import ReportFilterForm + +# from .filter import ReportFilterForm from rh.models import ImplementationModalityType, Indicator, Location, Project from .forms import ( @@ -22,9 +23,11 @@ TargetLocationReportFormSet, ) from .models import ActivityPlanReport, DisaggregationLocationReport, ProjectMonthlyReport, TargetLocationReport -from django.core.paginator import Paginator + +# from django.core.paginator import Paginator RECORDS_PER_PAGE = 10 + @cache_control(no_store=True) @login_required def index_project_report_view(request, project): diff --git a/src/rh/filters.py b/src/rh/filters.py index 96464f7c..632e79eb 100644 --- a/src/rh/filters.py +++ b/src/rh/filters.py @@ -7,24 +7,20 @@ class ProjectsFilter(django_filters.FilterSet): # FIXME: Fix the options issue clusters = django_filters.ModelMultipleChoiceFilter( - queryset=Cluster.objects.all(), - widget=forms.SelectMultiple(attrs={"class":"input-select"}) + queryset=Cluster.objects.all(), widget=forms.SelectMultiple(attrs={"class": "input-select"}) ) implementing_partners = django_filters.ModelMultipleChoiceFilter( - queryset=Organization.objects.all(), - widget=forms.SelectMultiple(attrs={"class":"input-select"}) + queryset=Organization.objects.all(), widget=forms.SelectMultiple(attrs={"class": "input-select"}) ) donors = django_filters.ModelMultipleChoiceFilter( queryset=Donor.objects.all(), - widget=forms.SelectMultiple(attrs={"class":"input-select"}), + widget=forms.SelectMultiple(attrs={"class": "input-select"}), ) programme_partners = django_filters.ModelMultipleChoiceFilter( - queryset=Organization.objects.all(), - widget=forms.SelectMultiple(attrs={"class":"input-select"}) + queryset=Organization.objects.all(), widget=forms.SelectMultiple(attrs={"class": "input-select"}) ) activity_domains = django_filters.ModelMultipleChoiceFilter( - queryset=ActivityDomain.objects.all(), - widget=forms.SelectMultiple(attrs={"class":"input-select"}) + queryset=ActivityDomain.objects.all(), widget=forms.SelectMultiple(attrs={"class": "input-select"}) ) class Meta: