-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e34dc9
commit 8db67a1
Showing
9 changed files
with
126 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import django_filters | ||
from django import forms | ||
|
||
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() | ||
) | ||
organization = django_filters.ModelMultipleChoiceFilter( | ||
queryset = Organization.objects.all(), | ||
widget=forms.SelectMultiple(), | ||
) | ||
activity_domains = django_filters.ModelChoiceFilter( | ||
queryset = ActivityDomain.objects.all(), | ||
widget=forms.SelectMultiple(), | ||
) | ||
country = django_filters.ModelChoiceFilter( | ||
queryset = Location.objects.filter(type="Country"), | ||
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"), | ||
widget=forms.Select(), | ||
) | ||
class Meta: | ||
model = ProjectMonthlyReport | ||
fields = "__all__" |
19 changes: 19 additions & 0 deletions
19
src/project_reports/migrations/0005_alter_activityplanreport_report_types.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Generated by Django 4.0.6 on 2023-12-27 03:31 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('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'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters