akvo.rest.views.program_results_geo module

class akvo.rest.views.program_results_geo.ContributionPerCountryVisitor(result: akvo.rest.views.program_results_geo.ResultData, indicator: akvo.rest.views.program_results_geo.IndicatorData, period: akvo.rest.views.program_results_geo.PeriodData, countries: Dict[str, akvo.rest.views.program_results_geo.ContributionValue] = <factory>)[source]

Bases: object

classmethod collect(result, indicator, period)[source]
countries: Dict[str, ContributionValue]
indicator: IndicatorData
period: PeriodData
result: ResultData
visit(contributor)[source]
class akvo.rest.views.program_results_geo.ContributionValue(target: decimal.Decimal | NoneType = None, value: decimal.Decimal | NoneType = None, numerator: decimal.Decimal | NoneType = None, denominator: decimal.Decimal | NoneType = None)[source]

Bases: object

add_fraction(numerator, denominator)[source]
add_target(target)[source]
add_value(value)[source]
denominator: Decimal | None = None
numerator: Decimal | None = None
target: Decimal | None = None
value: Decimal | None = None
class akvo.rest.views.program_results_geo.ContributorData(id: int, parent: Union[int, NoneType] = None, indicator_type: int = 1, indicator_measure: str = '', target_value: Union[str, NoneType] = None, indicator_target_value: Union[decimal.Decimal, NoneType] = None, project: Union[akvo.rest.views.program_results_geo.ContributorProjectData, NoneType] = None, updates: List[akvo.rest.views.program_results_geo.PeriodUpdateData] = <factory>, contributors: List[ForwardRef('ContributorData')] = <factory>)[source]

Bases: ReportingPeriodMixin

accept(visitor)[source]
property actual_value
property contributing_countries
id: int
indicator_measure: str = ''
indicator_target_value: Decimal | None = None
indicator_type: int = 1
classmethod make(data, prefix='')[source]
parent: int | None = None
project: ContributorProjectData | None = None
target_value: str | None = None
class akvo.rest.views.program_results_geo.ContributorProjectData(id: Union[int, NoneType] = None, title: str = '', country_code: Union[str, NoneType] = None, aggregate_children: bool = True, aggregate_to_parent: bool = True, sector_codes: Set[str] = <factory>)[source]

Bases: object

aggregate_children: bool = True
aggregate_to_parent: bool = True
country_code: str | None = None
id: int | None = None
classmethod make(data, prefix='')[source]
sector_codes: Set[str]
title: str = ''
class akvo.rest.views.program_results_geo.IndicatorData(id: int, title: str = '', type: int = 1, measure: str = '', description: str = '', baseline_year: Union[int, NoneType] = None, baseline_value: str = '', baseline_comment: str = '', target_value: Union[decimal.Decimal, NoneType] = None, target_comment: str = '', periods: List[akvo.rest.views.program_results_geo.PeriodData] = <factory>)[source]

Bases: object

baseline_comment: str = ''
baseline_value: str = ''
baseline_year: int | None = None
property contributing_countries
description: str = ''
id: int
property is_percentage
property is_quantitative
classmethod make(data, prefix='')[source]
measure: str = ''
periods: List[PeriodData]
target_comment: str = ''
target_value: Decimal | None = None
title: str = ''
type: int = 1
class akvo.rest.views.program_results_geo.PeriodData(id: int, period_start: Union[datetime.date, NoneType] = None, period_end: Union[datetime.date, NoneType] = None, target_value: Union[str, NoneType] = None, target_comment: str = '', actual_value: str = '', actual_comment: str = '', narrative: str = '', indicator_type: int = 1, indicator_measure: str = '', updates: List[akvo.rest.views.program_results_geo.PeriodUpdateData] = <factory>, contributors: List[akvo.rest.views.program_results_geo.ContributorData] = <factory>)[source]

Bases: ReportingPeriodMixin

actual_comment: str = ''
actual_value: str = ''
property aggregated_value
property contributing_countries
id: int
indicator_measure: str = ''
indicator_type: int = 1
classmethod make(data, prefix='')[source]
narrative: str = ''
period_end: date | None = None
period_start: date | None = None
target_comment: str = ''
target_value: str | None = None
class akvo.rest.views.program_results_geo.PeriodUpdateData(id: int, status: str = 'D', value: decimal.Decimal | NoneType = None, numerator: decimal.Decimal | NoneType = None, denominator: decimal.Decimal | NoneType = None, narrative: str = '', created_at: datetime.date | NoneType = None, last_modified_at: datetime.date | NoneType = None)[source]

Bases: object

created_at: date | None = None
denominator: Decimal | None = None
id: int
property is_approved
last_modified_at: date | None = None
classmethod make(data, prefix='')[source]
narrative: str = ''
numerator: Decimal | None = None
status: str = 'D'
value: Decimal | None = None
class akvo.rest.views.program_results_geo.ReportingPeriodMixin[source]

Bases: ABC

property aggregated_denominator
property aggregated_indicator_target_value
property aggregated_numerator
property aggregated_target_value
property aggregated_value
property approved_updates
contributors: List[ContributorData] = Field(name=None,type=None,default=<dataclasses._MISSING_TYPE object>,default_factory=<class 'list'>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),_field_type=None)
property has_updates
indicator_measure: str = ''
indicator_type: int = 1
property is_percentage
property is_qualitative
property is_quantitative
target_value: str | None = None
updates: List[PeriodUpdateData] = Field(name=None,type=None,default=<dataclasses._MISSING_TYPE object>,default_factory=<class 'list'>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),_field_type=None)
property updates_denominator
property updates_numerator
property updates_value
class akvo.rest.views.program_results_geo.ResultData(id: int, title: str = '', description: str = '', type: str = '', aggregation_status: Union[bool, NoneType] = None, indicators: List[akvo.rest.views.program_results_geo.IndicatorData] = <factory>)[source]

Bases: object

aggregation_status: bool | None = None
property contributing_countries
description: str = ''
static get_codelist_name(code, version='2.03')[source]
property iati_type_name
id: int
indicators: List[IndicatorData]
classmethod make(data, prefix='')[source]
title: str = ''
type: str = ''
akvo.rest.views.program_results_geo.fetch_contributors(root_period_ids)[source]
akvo.rest.views.program_results_geo.fetch_periods(project)[source]
akvo.rest.views.program_results_geo.get_contributors(root_period_ids)[source]
akvo.rest.views.program_results_geo.get_countries_geojson()[source]
akvo.rest.views.program_results_geo.get_geo_data(project)[source]
akvo.rest.views.program_results_geo.get_indicators_by_country(project)[source]
akvo.rest.views.program_results_geo.get_program_results_geo(request, *args, **kwargs)[source]
akvo.rest.views.program_results_geo.get_results_framework(project)[source]
akvo.rest.views.program_results_geo.hierarchize_contributors(contributors)[source]