Skip to content

Commit

Permalink
Merge branch 'release/2.11'
Browse files Browse the repository at this point in the history
* release/2.11:
  bump version
  closes #18276 - Add 'Achievement in reporting period' field to the prp/datareport endpoint
  Bump version: 2.10.1 → 2.11.0a
  • Loading branch information
saxix committed Feb 19, 2020
2 parents 7997751 + c1237d7 commit 01c267c
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.10.3
current_version = 2.11
commit = False
tag = False
allow_dirty = True
Expand Down
5 changes: 5 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2.11
----
* fixes #18276 - Add `Achievement in reporting period` field to the prp/datareport endpoint


2.10.3
------
* fixes Intervention.frs
Expand Down
2 changes: 1 addition & 1 deletion docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ DATABASE_URL_ETOOLS?=
DEVELOP?=1
DOCKER_PASS?=
DOCKER_USER?=
TARGET?=2.10.3
TARGET?=2.11
PUSH_BASE?=1
BASE?=$(shell echo "${TARGET}" | sed "s/\([0-9]*\)\.\([0-9]*\)\.\(.*\)/\1.\2/g" )
#BASE?=$(shell echo "${TARGET}" | sed "s/\([0-9]*\)\.\([0-9]*\)\.\(.*\)/\1.\2/g" | echo "`xargs`xx" )
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "datamart-core"
version = "2.10.3"
version = "2.11"
description = ""
authors = ["sax <s.apostolico@gmail.com>"]

Expand Down
4 changes: 2 additions & 2 deletions src/etools_datamart/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import warnings

NAME = 'etools-datamart'
VERSION = __version__ = '2.10.3'
VERSION = __version__ = '2.11'
__author__ = ''

# UserWarning: The psycopg2 wheel package will be renamed from release 2.10.3;
# UserWarning: The psycopg2 wheel package will be renamed from release 2.11;
warnings.simplefilter("ignore", UserWarning, 144)
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.2.9 on 2020-02-13 15:21

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('prp', '0006_auto_20191208_2144'),
]

operations = [
migrations.AddField(
model_name='datareport',
name='achievement_in_reporting_period',
field=models.CharField(blank=True, max_length=2048, null=True),
),
]
10 changes: 9 additions & 1 deletion src/etools_datamart/apps/mart/prp/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ def get_value(self, field_name, value_or_func, original_record, current_mapping)
return super().get_value(field_name, value_or_func, original_record, current_mapping)

def get_values(self, record: IndicatorIndicatorlocationdata):
record._indicator: IndicatorIndicatorreport = record.indicator_report
record._reportable: IndicatorReportable = record.indicator_report.reportable
return super().get_values(record)

Expand Down Expand Up @@ -286,6 +287,9 @@ def get_programme_document(self, record: IndicatorIndicatorlocationdata, values,
return cp_output.programme_document.title
return None

def get_achievement_in_reporting_period(self, record: IndicatorIndicatorlocationdata, values, **kwargs):
return record._indicator.total["c"]

def get_total_cumulative_progress(self, record: IndicatorIndicatorlocationdata, values, **kwargs):
return record._reportable.total["c"]

Expand Down Expand Up @@ -395,6 +399,8 @@ class DataReport(PrpDataMartModel):
total_cumulative_progress_in_location = models.CharField(max_length=2048, blank=True, null=True)
# total_cumulative_progress | reportable.total["c"] |
total_cumulative_progress = models.CharField(max_length=2048, blank=True, null=True)
achievement_in_reporting_period = models.CharField(max_length=2048, blank=True, null=True)

loader = DataReportLoader()

class Meta:
Expand Down Expand Up @@ -442,5 +448,7 @@ class Options:
'current_location': 'location.title',
'previous_location_progress': 'previous_location_data.title',
'total_cumulative_progress_in_location': 'N/A',
'total_cumulative_progress': '-'
'total_cumulative_progress': '-',
'achievement_in_reporting_period': '-',

}

0 comments on commit 01c267c

Please sign in to comment.