From e6429df4b8ebfebf490f945d7d473d76cfe1e91e Mon Sep 17 00:00:00 2001 From: sax Date: Sun, 29 Dec 2019 08:55:21 +0100 Subject: [PATCH 1/3] =?UTF-8?q?Bump=20version:=202.10.1=20=E2=86=92=202.11?= =?UTF-8?q?.0a?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- docker/Makefile | 2 +- pyproject.toml | 2 +- src/etools_datamart/__init__.py | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index e054081de..164050478 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 2.10.1 +current_version = 2.11.0a commit = False tag = False allow_dirty = True diff --git a/docker/Makefile b/docker/Makefile index fce784ada..35493b138 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -4,7 +4,7 @@ DATABASE_URL_ETOOLS?= DEVELOP?=1 DOCKER_PASS?= DOCKER_USER?= -TARGET?=2.10.1 +TARGET?=2.11.0a 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" ) diff --git a/pyproject.toml b/pyproject.toml index ec1290c83..c8f4e4fdb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "datamart-core" -version = "2.10.1" +version = "2.11.0a" description = "" authors = ["sax "] diff --git a/src/etools_datamart/__init__.py b/src/etools_datamart/__init__.py index 770a8ce6a..b3bed01c5 100644 --- a/src/etools_datamart/__init__.py +++ b/src/etools_datamart/__init__.py @@ -1,8 +1,8 @@ import warnings NAME = 'etools-datamart' -VERSION = __version__ = '2.10.1' +VERSION = __version__ = '2.11.0a' __author__ = '' -# UserWarning: The psycopg2 wheel package will be renamed from release 2.10.1; +# UserWarning: The psycopg2 wheel package will be renamed from release 2.11.0a; warnings.simplefilter("ignore", UserWarning, 144) From d26c07ca290eb43346e1ac3b3c776910407e5f9f Mon Sep 17 00:00:00 2001 From: sax Date: Mon, 17 Feb 2020 09:59:44 -0500 Subject: [PATCH 2/3] closes #18276 - Add 'Achievement in reporting period' field to the prp/datareport endpoint --- ...tareport_achievement_in_reporting_period.py | 18 ++++++++++++++++++ src/etools_datamart/apps/mart/prp/models.py | 10 +++++++++- .../_test_lib/test_utilities/factories/data.py | 5 +++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 src/etools_datamart/apps/mart/prp/migrations/0007_datareport_achievement_in_reporting_period.py diff --git a/src/etools_datamart/apps/mart/prp/migrations/0007_datareport_achievement_in_reporting_period.py b/src/etools_datamart/apps/mart/prp/migrations/0007_datareport_achievement_in_reporting_period.py new file mode 100644 index 000000000..1de933e1a --- /dev/null +++ b/src/etools_datamart/apps/mart/prp/migrations/0007_datareport_achievement_in_reporting_period.py @@ -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), + ), + ] diff --git a/src/etools_datamart/apps/mart/prp/models.py b/src/etools_datamart/apps/mart/prp/models.py index 8c2c1522b..2ed9d6472 100644 --- a/src/etools_datamart/apps/mart/prp/models.py +++ b/src/etools_datamart/apps/mart/prp/models.py @@ -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) @@ -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"] @@ -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: @@ -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': '-', + } diff --git a/tests/_test_lib/test_utilities/factories/data.py b/tests/_test_lib/test_utilities/factories/data.py index 94ef24b21..dce3b9094 100644 --- a/tests/_test_lib/test_utilities/factories/data.py +++ b/tests/_test_lib/test_utilities/factories/data.py @@ -290,3 +290,8 @@ class SpotCheckFactory(DataMartModelFactory): class Meta: model = models.SpotCheck + + +class PartnerStaffMemberFactory(DataMartModelFactory): + class Meta: + model = models.PartnerStaffMember From c1237d70e8fe82e06102c4e790afeb8b3e095df8 Mon Sep 17 00:00:00 2001 From: sax Date: Wed, 19 Feb 2020 08:35:29 -0500 Subject: [PATCH 3/3] bump version --- .bumpversion.cfg | 2 +- CHANGES | 4 ++++ docker/Makefile | 2 +- pyproject.toml | 2 +- src/etools_datamart/__init__.py | 4 ++-- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 4544e35c9..744a13b31 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 2.11.0a0 +current_version = 2.11 commit = False tag = False allow_dirty = True diff --git a/CHANGES b/CHANGES index 102ce8fcb..3d33a0696 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +2.11 +---- +* fixes #18276 - Add `Achievement in reporting period` field to the prp/datareport endpoint + 2.10.1 ------ * use poetry instead of pipenv diff --git a/docker/Makefile b/docker/Makefile index 35493b138..4b5c2b4bd 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -4,7 +4,7 @@ DATABASE_URL_ETOOLS?= DEVELOP?=1 DOCKER_PASS?= DOCKER_USER?= -TARGET?=2.11.0a +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" ) diff --git a/pyproject.toml b/pyproject.toml index c8f4e4fdb..36a6adef4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "datamart-core" -version = "2.11.0a" +version = "2.11" description = "" authors = ["sax "] diff --git a/src/etools_datamart/__init__.py b/src/etools_datamart/__init__.py index b3bed01c5..d28a9926d 100644 --- a/src/etools_datamart/__init__.py +++ b/src/etools_datamart/__init__.py @@ -1,8 +1,8 @@ import warnings NAME = 'etools-datamart' -VERSION = __version__ = '2.11.0a' +VERSION = __version__ = '2.11' __author__ = '' -# UserWarning: The psycopg2 wheel package will be renamed from release 2.11.0a; +# UserWarning: The psycopg2 wheel package will be renamed from release 2.11; warnings.simplefilter("ignore", UserWarning, 144)