diff --git a/djangoproject/settings.py b/djangoproject/settings.py index 945b3fa..278fb3b 100755 --- a/djangoproject/settings.py +++ b/djangoproject/settings.py @@ -148,13 +148,14 @@ def load_json_schema_filter_keys(filename): "project": { "json_schema": load_json_schema("project.json"), "spreadsheet_form_guide": os.path.join( - BASE_DIR, "indigo", "spreadsheetform_guides", "project_v009.xlsx", + BASE_DIR, "indigo", "spreadsheetform_guides", "project_v010.xlsx", ), - "spreadsheet_form_guide_spec": load_guide_form_spec("project_v009.xlsx"), + "spreadsheet_form_guide_spec": load_guide_form_spec("project_v010.xlsx"), "spreadsheet_form_guide_spec_versions": { 7: load_guide_form_spec("project_v007.xlsx"), 8: load_guide_form_spec("project_v008.xlsx"), 9: load_guide_form_spec("project_v009.xlsx"), + 10: load_guide_form_spec("project_v010.xlsx"), }, "fields": load_json_schema_fields("project.json"), "filter_keys": load_json_schema_filter_keys("project.json"), @@ -185,6 +186,8 @@ def load_json_schema_filter_keys(filename): APP_TITLE = os.getenv("APP_TITLE", "INDIGO") +API_SANDBOX_DATA_PASSWORD = os.getenv("API_SANDBOX_DATA_PASSWORD", "") + SENTRY_DSN = os.getenv("SENTRY_DSN") if SENTRY_DSN: import sentry_sdk diff --git a/indigo/admin.py b/indigo/admin.py index 6af52da..4dd11a9 100755 --- a/indigo/admin.py +++ b/indigo/admin.py @@ -1,3 +1,5 @@ -from django.contrib import admin # noqa +from django.contrib import admin -# Register your models here. +from indigo.models import Sandbox + +admin.site.register(Sandbox) diff --git a/indigo/jsonschema/cached_information/project.json.fields.json b/indigo/jsonschema/cached_information/project.json.fields.json index d1af03e..d10b231 100644 --- a/indigo/jsonschema/cached_information/project.json.fields.json +++ b/indigo/jsonschema/cached_information/project.json.fields.json @@ -998,7 +998,11 @@ }, { "key": "/status", - "title": "Status" + "title": "(Status)" + }, + { + "key": "/sandboxes", + "title": "(In Sandboxes)" } ], "key": "/transactions", diff --git a/indigo/jsonschema/project.json b/indigo/jsonschema/project.json index 83dc83d..d1f972b 100644 --- a/indigo/jsonschema/project.json +++ b/indigo/jsonschema/project.json @@ -1120,8 +1120,10 @@ "type": "string" }, "status": { - "title": "Status", - "type": "string" + "$ref": "#/definitions/status" + }, + "sandboxes": { + "$ref": "#/definitions/sandboxes" } } }, @@ -1702,9 +1704,14 @@ "type": "string", "enum": [ "PUBLIC", + "SANDBOX", "PRIVATE", "DISPUTED" ] + }, + "sandboxes": { + "title": "(In Sandboxes)", + "type": "string" } } } diff --git a/indigo/migrations/0012_auto_20210210_1152.py b/indigo/migrations/0012_auto_20210210_1152.py new file mode 100644 index 0000000..637d42a --- /dev/null +++ b/indigo/migrations/0012_auto_20210210_1152.py @@ -0,0 +1,45 @@ +# Generated by Django 3.1.5 on 2021-02-10 11:52 + +import django.contrib.postgres.fields.jsonb +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("indigo", "0011_project_data_quality_report_counts_by_priority"), + ] + + operations = [ + migrations.CreateModel( + name="Sandbox", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("public_id", models.CharField(max_length=200, unique=True)), + ("title", models.TextField(default="")), + ], + ), + migrations.AddField( + model_name="fund", + name="data_sandboxes", + field=django.contrib.postgres.fields.jsonb.JSONField(default=dict), + ), + migrations.AddField( + model_name="organisation", + name="data_sandboxes", + field=django.contrib.postgres.fields.jsonb.JSONField(default=dict), + ), + migrations.AddField( + model_name="project", + name="data_sandboxes", + field=django.contrib.postgres.fields.jsonb.JSONField(default=dict), + ), + ] diff --git a/indigo/models.py b/indigo/models.py index 5acff03..ff7f6c6 100755 --- a/indigo/models.py +++ b/indigo/models.py @@ -17,6 +17,7 @@ class BaseModel(models.Model): status_public = models.BooleanField(default=False) data_public = JSONField(default=dict) data_private = JSONField(default=dict) + data_sandboxes = JSONField(default=dict) # record is nullable for historical data - it should be NOT NULL really record = models.ForeignKey(Record, on_delete=models.PROTECT, null=True, blank=True) full_text_search_private = models.TextField(default="") @@ -107,3 +108,8 @@ class Meta: "project", "fund", ) + + +class Sandbox(models.Model): + public_id = models.CharField(max_length=200, unique=True) + title = models.TextField(default="") diff --git a/indigo/spreadsheetform_guides/cached_information/project_v010.xlsx.guidespec.json b/indigo/spreadsheetform_guides/cached_information/project_v010.xlsx.guidespec.json new file mode 100644 index 0000000..5f7c27c --- /dev/null +++ b/indigo/spreadsheetform_guides/cached_information/project_v010.xlsx.guidespec.json @@ -0,0 +1,2903 @@ +{ + "worksheets": { + "360Giving": { + "down_configs": { + "360giving_datas": [ + { + "column": 1, + "column_letter": "A", + "coordinate": "A4", + "item_path": "grant_id", + "list_path": "360giving_datas", + "mode": "down", + "row": 4 + }, + { + "column": 2, + "column_letter": "B", + "coordinate": "B4", + "item_path": "source_ids", + "list_path": "360giving_datas", + "mode": "down", + "row": 4 + }, + { + "column": 3, + "column_letter": "C", + "coordinate": "C4", + "item_path": "notes", + "list_path": "360giving_datas", + "mode": "down", + "row": 4 + }, + { + "column": 4, + "column_letter": "D", + "coordinate": "D4", + "item_path": "status", + "list_path": "360giving_datas", + "mode": "down", + "row": 4 + } + ] + }, + "right_configs": {}, + "single_configs": {} + }, + "CountryCodeOptions": { + "down_configs": {}, + "right_configs": {}, + "single_configs": {} + }, + "Delivery Locations": { + "down_configs": { + "delivery_locations": [ + { + "column": 1, + "column_letter": "A", + "coordinate": "A4", + "item_path": "service_provision_id/value", + "list_path": "delivery_locations", + "mode": "down", + "row": 4 + }, + { + "column": 2, + "column_letter": "B", + "coordinate": "B4", + "item_path": "location_name/value", + "list_path": "delivery_locations", + "mode": "down", + "row": 4 + }, + { + "column": 3, + "column_letter": "C", + "coordinate": "C4", + "item_path": "location_postcode/value", + "list_path": "delivery_locations", + "mode": "down", + "row": 4 + }, + { + "column": 4, + "column_letter": "D", + "coordinate": "D4", + "item_path": "location_country/value", + "list_path": "delivery_locations", + "mode": "down", + "row": 4 + }, + { + "column": 5, + "column_letter": "E", + "coordinate": "E4", + "item_path": "lat_lng/lat/value", + "list_path": "delivery_locations", + "mode": "down", + "row": 4 + }, + { + "column": 6, + "column_letter": "F", + "coordinate": "F4", + "item_path": "lat_lng/lng/value", + "list_path": "delivery_locations", + "mode": "down", + "row": 4 + }, + { + "column": 7, + "column_letter": "G", + "coordinate": "G4", + "item_path": "adminstrative_geography_name/value", + "list_path": "delivery_locations", + "mode": "down", + "row": 4 + }, + { + "column": 8, + "column_letter": "H", + "coordinate": "H4", + "item_path": "adminstrative_geography_code_type/value", + "list_path": "delivery_locations", + "mode": "down", + "row": 4 + }, + { + "column": 9, + "column_letter": "I", + "coordinate": "I4", + "item_path": "adminstrative_geography_code/value", + "list_path": "delivery_locations", + "mode": "down", + "row": 4 + }, + { + "column": 10, + "column_letter": "J", + "coordinate": "J4", + "item_path": "source_ids", + "list_path": "delivery_locations", + "mode": "down", + "row": 4 + }, + { + "column": 11, + "column_letter": "K", + "coordinate": "K4", + "item_path": "notes", + "list_path": "delivery_locations", + "mode": "down", + "row": 4 + }, + { + "column": 12, + "column_letter": "L", + "coordinate": "L4", + "item_path": "status", + "list_path": "delivery_locations", + "mode": "down", + "row": 4 + } + ] + }, + "right_configs": {}, + "single_configs": {} + }, + "Documents": { + "down_configs": { + "documents": [ + { + "column": 1, + "column_letter": "A", + "coordinate": "A4", + "item_path": "title/value", + "list_path": "documents", + "mode": "down", + "row": 4 + }, + { + "column": 2, + "column_letter": "B", + "coordinate": "B4", + "item_path": "url/value", + "list_path": "documents", + "mode": "down", + "row": 4 + }, + { + "column": 3, + "column_letter": "C", + "coordinate": "C4", + "item_path": "notes", + "list_path": "documents", + "mode": "down", + "row": 4 + }, + { + "column": 4, + "column_letter": "D", + "coordinate": "D4", + "item_path": "status", + "list_path": "documents", + "mode": "down", + "row": 4 + } + ] + }, + "right_configs": {}, + "single_configs": {} + }, + "General Overview": { + "down_configs": {}, + "right_configs": {}, + "single_configs": { + "alternative_names/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C6", + "mode": "single", + "path": "alternative_names/value", + "row": 6 + }, + "changes_to_project_due_to_covid19/source_ids": { + "column": 4, + "column_letter": "D", + "coordinate": "D79", + "mode": "single", + "path": "changes_to_project_due_to_covid19/source_ids", + "row": 79 + }, + "changes_to_project_due_to_covid19/status": { + "column": 5, + "column_letter": "E", + "coordinate": "E79", + "mode": "single", + "path": "changes_to_project_due_to_covid19/status", + "row": 79 + }, + "changes_to_project_due_to_covid19/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C79", + "mode": "single", + "path": "changes_to_project_due_to_covid19/value", + "row": 79 + }, + "dates/actual_completion_date/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D18", + "mode": "single", + "path": "dates/actual_completion_date/status", + "row": 18 + }, + "dates/actual_completion_date/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C18", + "mode": "single", + "path": "dates/actual_completion_date/value", + "row": 18 + }, + "dates/actual_end_date_of_service_provision/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D21", + "mode": "single", + "path": "dates/actual_end_date_of_service_provision/status", + "row": 21 + }, + "dates/actual_end_date_of_service_provision/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C21", + "mode": "single", + "path": "dates/actual_end_date_of_service_provision/value", + "row": 21 + }, + "dates/anticipated_completion_date/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D17", + "mode": "single", + "path": "dates/anticipated_completion_date/status", + "row": 17 + }, + "dates/anticipated_completion_date/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C17", + "mode": "single", + "path": "dates/anticipated_completion_date/value", + "row": 17 + }, + "dates/anticipated_end_date_of_service_provision/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D20", + "mode": "single", + "path": "dates/anticipated_end_date_of_service_provision/status", + "row": 20 + }, + "dates/anticipated_end_date_of_service_provision/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C20", + "mode": "single", + "path": "dates/anticipated_end_date_of_service_provision/value", + "row": 20 + }, + "dates/contracts_between_all_parties_signed/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D16", + "mode": "single", + "path": "dates/contracts_between_all_parties_signed/status", + "row": 16 + }, + "dates/contracts_between_all_parties_signed/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C16", + "mode": "single", + "path": "dates/contracts_between_all_parties_signed/value", + "row": 16 + }, + "dates/notes": { + "column": 3, + "column_letter": "C", + "coordinate": "C23", + "mode": "single", + "path": "dates/notes", + "row": 23 + }, + "dates/outcomes_contract_signed/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D15", + "mode": "single", + "path": "dates/outcomes_contract_signed/status", + "row": 15 + }, + "dates/outcomes_contract_signed/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C15", + "mode": "single", + "path": "dates/outcomes_contract_signed/value", + "row": 15 + }, + "dates/source_ids": { + "column": 3, + "column_letter": "C", + "coordinate": "C22", + "mode": "single", + "path": "dates/source_ids", + "row": 22 + }, + "dates/start_date_of_service_provision/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D19", + "mode": "single", + "path": "dates/start_date_of_service_provision/status", + "row": 19 + }, + "dates/start_date_of_service_provision/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C19", + "mode": "single", + "path": "dates/start_date_of_service_provision/value", + "row": 19 + }, + "investment_details/internal_rate_of_return/date/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D52", + "mode": "single", + "path": "investment_details/internal_rate_of_return/date/status", + "row": 52 + }, + "investment_details/internal_rate_of_return/date/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C52", + "mode": "single", + "path": "investment_details/internal_rate_of_return/date/value", + "row": 52 + }, + "investment_details/internal_rate_of_return/latest/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D51", + "mode": "single", + "path": "investment_details/internal_rate_of_return/latest/status", + "row": 51 + }, + "investment_details/internal_rate_of_return/latest/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C51", + "mode": "single", + "path": "investment_details/internal_rate_of_return/latest/value", + "row": 51 + }, + "investment_details/internal_rate_of_return/target/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D50", + "mode": "single", + "path": "investment_details/internal_rate_of_return/target/status", + "row": 50 + }, + "investment_details/internal_rate_of_return/target/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C50", + "mode": "single", + "path": "investment_details/internal_rate_of_return/target/value", + "row": 50 + }, + "investment_details/notes": { + "column": 3, + "column_letter": "C", + "coordinate": "C54", + "mode": "single", + "path": "investment_details/notes", + "row": 54 + }, + "investment_details/source_ids": { + "column": 3, + "column_letter": "C", + "coordinate": "C53", + "mode": "single", + "path": "investment_details/source_ids", + "row": 53 + }, + "investment_details/total_funds_invested/latest/amount/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D47", + "mode": "single", + "path": "investment_details/total_funds_invested/latest/amount/status", + "row": 47 + }, + "investment_details/total_funds_invested/latest/amount/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C47", + "mode": "single", + "path": "investment_details/total_funds_invested/latest/amount/value", + "row": 47 + }, + "investment_details/total_funds_invested/latest/amount_usd/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D48", + "mode": "single", + "path": "investment_details/total_funds_invested/latest/amount_usd/status", + "row": 48 + }, + "investment_details/total_funds_invested/latest/amount_usd/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C48", + "mode": "single", + "path": "investment_details/total_funds_invested/latest/amount_usd/value", + "row": 48 + }, + "investment_details/total_funds_invested/latest/currency/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D46", + "mode": "single", + "path": "investment_details/total_funds_invested/latest/currency/status", + "row": 46 + }, + "investment_details/total_funds_invested/latest/currency/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C46", + "mode": "single", + "path": "investment_details/total_funds_invested/latest/currency/value", + "row": 46 + }, + "investment_details/total_funds_invested/latest/date/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D49", + "mode": "single", + "path": "investment_details/total_funds_invested/latest/date/status", + "row": 49 + }, + "investment_details/total_funds_invested/latest/date/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C49", + "mode": "single", + "path": "investment_details/total_funds_invested/latest/date/value", + "row": 49 + }, + "name/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C5", + "mode": "single", + "path": "name/value", + "row": 5 + }, + "notes/status": { + "column": 3, + "column_letter": "C", + "coordinate": "C82", + "mode": "single", + "path": "notes/status", + "row": 82 + }, + "notes/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C81", + "mode": "single", + "path": "notes/value", + "row": 81 + }, + "overall_project_finance/configuration_contracting_parties/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D37", + "mode": "single", + "path": "overall_project_finance/configuration_contracting_parties/status", + "row": 37 + }, + "overall_project_finance/configuration_contracting_parties/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C37", + "mode": "single", + "path": "overall_project_finance/configuration_contracting_parties/value", + "row": 37 + }, + "overall_project_finance/investor_repayment/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D38", + "mode": "single", + "path": "overall_project_finance/investor_repayment/status", + "row": 38 + }, + "overall_project_finance/investor_repayment/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C38", + "mode": "single", + "path": "overall_project_finance/investor_repayment/value", + "row": 38 + }, + "overall_project_finance/maximum_potential_loss/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D34", + "mode": "single", + "path": "overall_project_finance/maximum_potential_loss/status", + "row": 34 + }, + "overall_project_finance/maximum_potential_loss/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C34", + "mode": "single", + "path": "overall_project_finance/maximum_potential_loss/value", + "row": 34 + }, + "overall_project_finance/maximum_potential_outcome_payment/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D33", + "mode": "single", + "path": "overall_project_finance/maximum_potential_outcome_payment/status", + "row": 33 + }, + "overall_project_finance/maximum_potential_outcome_payment/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C33", + "mode": "single", + "path": "overall_project_finance/maximum_potential_outcome_payment/value", + "row": 33 + }, + "overall_project_finance/maximum_potential_return/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D36", + "mode": "single", + "path": "overall_project_finance/maximum_potential_return/status", + "row": 36 + }, + "overall_project_finance/maximum_potential_return/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C36", + "mode": "single", + "path": "overall_project_finance/maximum_potential_return/value", + "row": 36 + }, + "overall_project_finance/maximum_potential_return_type/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D35", + "mode": "single", + "path": "overall_project_finance/maximum_potential_return_type/status", + "row": 35 + }, + "overall_project_finance/maximum_potential_return_type/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C35", + "mode": "single", + "path": "overall_project_finance/maximum_potential_return_type/value", + "row": 35 + }, + "overall_project_finance/notes": { + "column": 3, + "column_letter": "C", + "coordinate": "C43", + "mode": "single", + "path": "overall_project_finance/notes", + "row": 43 + }, + "overall_project_finance/source_ids": { + "column": 3, + "column_letter": "C", + "coordinate": "C42", + "mode": "single", + "path": "overall_project_finance/source_ids", + "row": 42 + }, + "overall_project_finance/total_investment_commitment/amount/exact/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D28", + "mode": "single", + "path": "overall_project_finance/total_investment_commitment/amount/exact/status", + "row": 28 + }, + "overall_project_finance/total_investment_commitment/amount/exact/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C28", + "mode": "single", + "path": "overall_project_finance/total_investment_commitment/amount/exact/value", + "row": 28 + }, + "overall_project_finance/total_investment_commitment/amount/max/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D29", + "mode": "single", + "path": "overall_project_finance/total_investment_commitment/amount/max/status", + "row": 29 + }, + "overall_project_finance/total_investment_commitment/amount/max/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C29", + "mode": "single", + "path": "overall_project_finance/total_investment_commitment/amount/max/value", + "row": 29 + }, + "overall_project_finance/total_investment_commitment/amount/min/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D27", + "mode": "single", + "path": "overall_project_finance/total_investment_commitment/amount/min/status", + "row": 27 + }, + "overall_project_finance/total_investment_commitment/amount/min/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C27", + "mode": "single", + "path": "overall_project_finance/total_investment_commitment/amount/min/value", + "row": 27 + }, + "overall_project_finance/total_investment_commitment/amount_usd/exact/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D31", + "mode": "single", + "path": "overall_project_finance/total_investment_commitment/amount_usd/exact/status", + "row": 31 + }, + "overall_project_finance/total_investment_commitment/amount_usd/exact/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C31", + "mode": "single", + "path": "overall_project_finance/total_investment_commitment/amount_usd/exact/value", + "row": 31 + }, + "overall_project_finance/total_investment_commitment/amount_usd/max/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D32", + "mode": "single", + "path": "overall_project_finance/total_investment_commitment/amount_usd/max/status", + "row": 32 + }, + "overall_project_finance/total_investment_commitment/amount_usd/max/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C32", + "mode": "single", + "path": "overall_project_finance/total_investment_commitment/amount_usd/max/value", + "row": 32 + }, + "overall_project_finance/total_investment_commitment/amount_usd/min/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D30", + "mode": "single", + "path": "overall_project_finance/total_investment_commitment/amount_usd/min/status", + "row": 30 + }, + "overall_project_finance/total_investment_commitment/amount_usd/min/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C30", + "mode": "single", + "path": "overall_project_finance/total_investment_commitment/amount_usd/min/value", + "row": 30 + }, + "overall_project_finance/total_investment_commitment/currency/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D26", + "mode": "single", + "path": "overall_project_finance/total_investment_commitment/currency/status", + "row": 26 + }, + "overall_project_finance/total_investment_commitment/currency/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C26", + "mode": "single", + "path": "overall_project_finance/total_investment_commitment/currency/value", + "row": 26 + }, + "overall_project_finance/total_outcome_payments_made/amount/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D40", + "mode": "single", + "path": "overall_project_finance/total_outcome_payments_made/amount/status", + "row": 40 + }, + "overall_project_finance/total_outcome_payments_made/amount/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C40", + "mode": "single", + "path": "overall_project_finance/total_outcome_payments_made/amount/value", + "row": 40 + }, + "overall_project_finance/total_outcome_payments_made/amount_usd/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D41", + "mode": "single", + "path": "overall_project_finance/total_outcome_payments_made/amount_usd/status", + "row": 41 + }, + "overall_project_finance/total_outcome_payments_made/amount_usd/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C41", + "mode": "single", + "path": "overall_project_finance/total_outcome_payments_made/amount_usd/value", + "row": 41 + }, + "overall_project_finance/total_outcome_payments_made/currency/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D39", + "mode": "single", + "path": "overall_project_finance/total_outcome_payments_made/currency/status", + "row": 39 + }, + "overall_project_finance/total_outcome_payments_made/currency/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C39", + "mode": "single", + "path": "overall_project_finance/total_outcome_payments_made/currency/value", + "row": 39 + }, + "purpose_and_classifications/intervention/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D58", + "mode": "single", + "path": "purpose_and_classifications/intervention/status", + "row": 58 + }, + "purpose_and_classifications/intervention/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C58", + "mode": "single", + "path": "purpose_and_classifications/intervention/value", + "row": 58 + }, + "purpose_and_classifications/notes": { + "column": 3, + "column_letter": "C", + "coordinate": "C65", + "mode": "single", + "path": "purpose_and_classifications/notes", + "row": 65 + }, + "purpose_and_classifications/policy_sector/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D59", + "mode": "single", + "path": "purpose_and_classifications/policy_sector/status", + "row": 59 + }, + "purpose_and_classifications/policy_sector/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C59", + "mode": "single", + "path": "purpose_and_classifications/policy_sector/value", + "row": 59 + }, + "purpose_and_classifications/primary_sdg_goal/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D60", + "mode": "single", + "path": "purpose_and_classifications/primary_sdg_goal/status", + "row": 60 + }, + "purpose_and_classifications/primary_sdg_goal/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C60", + "mode": "single", + "path": "purpose_and_classifications/primary_sdg_goal/value", + "row": 60 + }, + "purpose_and_classifications/primary_sdg_target/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D62", + "mode": "single", + "path": "purpose_and_classifications/primary_sdg_target/status", + "row": 62 + }, + "purpose_and_classifications/primary_sdg_target/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C62", + "mode": "single", + "path": "purpose_and_classifications/primary_sdg_target/value", + "row": 62 + }, + "purpose_and_classifications/secondary_sdg_goals/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D61", + "mode": "single", + "path": "purpose_and_classifications/secondary_sdg_goals/status", + "row": 61 + }, + "purpose_and_classifications/secondary_sdg_goals/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C61", + "mode": "single", + "path": "purpose_and_classifications/secondary_sdg_goals/value", + "row": 61 + }, + "purpose_and_classifications/secondary_sdg_targets/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D63", + "mode": "single", + "path": "purpose_and_classifications/secondary_sdg_targets/status", + "row": 63 + }, + "purpose_and_classifications/secondary_sdg_targets/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C63", + "mode": "single", + "path": "purpose_and_classifications/secondary_sdg_targets/value", + "row": 63 + }, + "purpose_and_classifications/social_challenge/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D57", + "mode": "single", + "path": "purpose_and_classifications/social_challenge/status", + "row": 57 + }, + "purpose_and_classifications/social_challenge/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C57", + "mode": "single", + "path": "purpose_and_classifications/social_challenge/value", + "row": 57 + }, + "purpose_and_classifications/source_ids": { + "column": 3, + "column_letter": "C", + "coordinate": "C64", + "mode": "single", + "path": "purpose_and_classifications/source_ids", + "row": 64 + }, + "service_and_beneficiaries/actual_number_service_users_or_beneficiaries_total/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D72", + "mode": "single", + "path": "service_and_beneficiaries/actual_number_service_users_or_beneficiaries_total/status", + "row": 72 + }, + "service_and_beneficiaries/actual_number_service_users_or_beneficiaries_total/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C72", + "mode": "single", + "path": "service_and_beneficiaries/actual_number_service_users_or_beneficiaries_total/value", + "row": 72 + }, + "service_and_beneficiaries/notes": { + "column": 3, + "column_letter": "C", + "coordinate": "C76", + "mode": "single", + "path": "service_and_beneficiaries/notes", + "row": 76 + }, + "service_and_beneficiaries/source_ids": { + "column": 3, + "column_letter": "C", + "coordinate": "C75", + "mode": "single", + "path": "service_and_beneficiaries/source_ids", + "row": 75 + }, + "service_and_beneficiaries/target_population/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D68", + "mode": "single", + "path": "service_and_beneficiaries/target_population/status", + "row": 68 + }, + "service_and_beneficiaries/target_population/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C68", + "mode": "single", + "path": "service_and_beneficiaries/target_population/value", + "row": 68 + }, + "service_and_beneficiaries/targeted_number_service_users_or_beneficiaries_total/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D69", + "mode": "single", + "path": "service_and_beneficiaries/targeted_number_service_users_or_beneficiaries_total/status", + "row": 69 + }, + "service_and_beneficiaries/targeted_number_service_users_or_beneficiaries_total/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C69", + "mode": "single", + "path": "service_and_beneficiaries/targeted_number_service_users_or_beneficiaries_total/value", + "row": 69 + }, + "service_and_beneficiaries/unit_description_of_actual_service_user_or_beneficiaries/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D74", + "mode": "single", + "path": "service_and_beneficiaries/unit_description_of_actual_service_user_or_beneficiaries/status", + "row": 74 + }, + "service_and_beneficiaries/unit_description_of_actual_service_user_or_beneficiaries/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C74", + "mode": "single", + "path": "service_and_beneficiaries/unit_description_of_actual_service_user_or_beneficiaries/value", + "row": 74 + }, + "service_and_beneficiaries/unit_description_of_service_user_or_beneficiaries/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D71", + "mode": "single", + "path": "service_and_beneficiaries/unit_description_of_service_user_or_beneficiaries/status", + "row": 71 + }, + "service_and_beneficiaries/unit_description_of_service_user_or_beneficiaries/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C71", + "mode": "single", + "path": "service_and_beneficiaries/unit_description_of_service_user_or_beneficiaries/value", + "row": 71 + }, + "service_and_beneficiaries/unit_type_actual_service_users_or_beneficiaries/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D73", + "mode": "single", + "path": "service_and_beneficiaries/unit_type_actual_service_users_or_beneficiaries/status", + "row": 73 + }, + "service_and_beneficiaries/unit_type_actual_service_users_or_beneficiaries/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C73", + "mode": "single", + "path": "service_and_beneficiaries/unit_type_actual_service_users_or_beneficiaries/value", + "row": 73 + }, + "service_and_beneficiaries/unit_type_targeted_service_users_or_beneficiaries/status": { + "column": 4, + "column_letter": "D", + "coordinate": "D70", + "mode": "single", + "path": "service_and_beneficiaries/unit_type_targeted_service_users_or_beneficiaries/status", + "row": 70 + }, + "service_and_beneficiaries/unit_type_targeted_service_users_or_beneficiaries/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C70", + "mode": "single", + "path": "service_and_beneficiaries/unit_type_targeted_service_users_or_beneficiaries/value", + "row": 70 + }, + "social_investment_prototype/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C12", + "mode": "single", + "path": "social_investment_prototype/value", + "row": 12 + }, + "stage_development/source_ids": { + "column": 4, + "column_letter": "D", + "coordinate": "D9", + "mode": "single", + "path": "stage_development/source_ids", + "row": 9 + }, + "stage_development/status": { + "column": 5, + "column_letter": "E", + "coordinate": "E9", + "mode": "single", + "path": "stage_development/status", + "row": 9 + }, + "stage_development/value": { + "column": 3, + "column_letter": "C", + "coordinate": "C9", + "mode": "single", + "path": "stage_development/value", + "row": 9 + }, + "status": { + "column": 3, + "column_letter": "C", + "coordinate": "C2", + "mode": "single", + "path": "status", + "row": 2 + } + } + }, + "Grants": { + "down_configs": { + "grants": [ + { + "column": 1, + "column_letter": "A", + "coordinate": "A5", + "item_path": "id", + "list_path": "grants", + "mode": "down", + "row": 5 + }, + { + "column": 2, + "column_letter": "B", + "coordinate": "B5", + "item_path": "360giving_id/value", + "list_path": "grants", + "mode": "down", + "row": 5 + }, + { + "column": 3, + "column_letter": "C", + "coordinate": "C5", + "item_path": "title/value", + "list_path": "grants", + "mode": "down", + "row": 5 + }, + { + "column": 4, + "column_letter": "D", + "coordinate": "D5", + "item_path": "award_date/value", + "list_path": "grants", + "mode": "down", + "row": 5 + }, + { + "column": 5, + "column_letter": "E", + "coordinate": "E5", + "item_path": "currency/value", + "list_path": "grants", + "mode": "down", + "row": 5 + }, + { + "column": 6, + "column_letter": "F", + "coordinate": "F5", + "item_path": "amount_applied_for/amount/value", + "list_path": "grants", + "mode": "down", + "row": 5 + }, + { + "column": 7, + "column_letter": "G", + "coordinate": "G5", + "item_path": "amount_applied_for/amount_usd/value", + "list_path": "grants", + "mode": "down", + "row": 5 + }, + { + "column": 8, + "column_letter": "H", + "coordinate": "H5", + "item_path": "amount_awarded/amount/value", + "list_path": "grants", + "mode": "down", + "row": 5 + }, + { + "column": 9, + "column_letter": "I", + "coordinate": "I5", + "item_path": "amount_awarded/amount_usd/value", + "list_path": "grants", + "mode": "down", + "row": 5 + }, + { + "column": 10, + "column_letter": "J", + "coordinate": "J5", + "item_path": "amount_disbursed/amount/value", + "list_path": "grants", + "mode": "down", + "row": 5 + }, + { + "column": 11, + "column_letter": "K", + "coordinate": "K5", + "item_path": "amount_disbursed/amount_usd/value", + "list_path": "grants", + "mode": "down", + "row": 5 + }, + { + "column": 12, + "column_letter": "L", + "coordinate": "L5", + "item_path": "recipient_organisation_id/value", + "list_path": "grants", + "mode": "down", + "row": 5 + }, + { + "column": 13, + "column_letter": "M", + "coordinate": "M5", + "item_path": "funding_organisation_id/value", + "list_path": "grants", + "mode": "down", + "row": 5 + }, + { + "column": 14, + "column_letter": "N", + "coordinate": "N5", + "item_path": "description/value", + "list_path": "grants", + "mode": "down", + "row": 5 + }, + { + "column": 15, + "column_letter": "O", + "coordinate": "O5", + "item_path": "purpose/value", + "list_path": "grants", + "mode": "down", + "row": 5 + }, + { + "column": 16, + "column_letter": "P", + "coordinate": "P5", + "item_path": "source_ids", + "list_path": "grants", + "mode": "down", + "row": 5 + }, + { + "column": 17, + "column_letter": "Q", + "coordinate": "Q5", + "item_path": "notes", + "list_path": "grants", + "mode": "down", + "row": 5 + }, + { + "column": 18, + "column_letter": "R", + "coordinate": "R5", + "item_path": "status", + "list_path": "grants", + "mode": "down", + "row": 5 + } + ] + }, + "right_configs": {}, + "single_configs": {} + }, + "Intermediary services": { + "down_configs": { + "intermediary_services": [ + { + "column": 1, + "column_letter": "A", + "coordinate": "A4", + "item_path": "organisation_id/value", + "list_path": "intermediary_services", + "mode": "down", + "row": 4 + }, + { + "column": 2, + "column_letter": "B", + "coordinate": "B4", + "item_path": "organisation_role_category/value", + "list_path": "intermediary_services", + "mode": "down", + "row": 4 + }, + { + "column": 3, + "column_letter": "C", + "coordinate": "C4", + "item_path": "other_role_description/value", + "list_path": "intermediary_services", + "mode": "down", + "row": 4 + }, + { + "column": 4, + "column_letter": "D", + "coordinate": "D4", + "item_path": "source_ids", + "list_path": "intermediary_services", + "mode": "down", + "row": 4 + }, + { + "column": 5, + "column_letter": "E", + "coordinate": "E4", + "item_path": "notes", + "list_path": "intermediary_services", + "mode": "down", + "row": 4 + }, + { + "column": 6, + "column_letter": "F", + "coordinate": "F4", + "item_path": "status", + "list_path": "intermediary_services", + "mode": "down", + "row": 4 + } + ] + }, + "right_configs": {}, + "single_configs": {} + }, + "Introduction": { + "down_configs": {}, + "right_configs": {}, + "single_configs": { + "id": { + "column": 2, + "column_letter": "B", + "coordinate": "B2", + "mode": "single", + "path": "id", + "row": 2 + } + } + }, + "Investments": { + "down_configs": { + "investments": [ + { + "column": 1, + "column_letter": "A", + "coordinate": "A5", + "item_path": "id", + "list_path": "investments", + "mode": "down", + "row": 5 + }, + { + "column": 2, + "column_letter": "B", + "coordinate": "B5", + "item_path": "organisation_id/value", + "list_path": "investments", + "mode": "down", + "row": 5 + }, + { + "column": 3, + "column_letter": "C", + "coordinate": "C5", + "item_path": "organisation_role_category/value", + "list_path": "investments", + "mode": "down", + "row": 5 + }, + { + "column": 4, + "column_letter": "D", + "coordinate": "D5", + "item_path": "investment_commitment/currency/value", + "list_path": "investments", + "mode": "down", + "row": 5 + }, + { + "column": 5, + "column_letter": "E", + "coordinate": "E5", + "item_path": "investment_commitment/amount/min/value", + "list_path": "investments", + "mode": "down", + "row": 5 + }, + { + "column": 6, + "column_letter": "F", + "coordinate": "F5", + "item_path": "investment_commitment/amount/exact/value", + "list_path": "investments", + "mode": "down", + "row": 5 + }, + { + "column": 7, + "column_letter": "G", + "coordinate": "G5", + "item_path": "investment_commitment/amount/max/value", + "list_path": "investments", + "mode": "down", + "row": 5 + }, + { + "column": 8, + "column_letter": "H", + "coordinate": "H5", + "item_path": "investment_commitment/amount_usd/min/value", + "list_path": "investments", + "mode": "down", + "row": 5 + }, + { + "column": 9, + "column_letter": "I", + "coordinate": "I5", + "item_path": "investment_commitment/amount_usd/exact/value", + "list_path": "investments", + "mode": "down", + "row": 5 + }, + { + "column": 10, + "column_letter": "J", + "coordinate": "J5", + "item_path": "investment_commitment/amount_usd/max/value", + "list_path": "investments", + "mode": "down", + "row": 5 + }, + { + "column": 11, + "column_letter": "K", + "coordinate": "K5", + "item_path": "maximum_potential_loss/value", + "list_path": "investments", + "mode": "down", + "row": 5 + }, + { + "column": 12, + "column_letter": "L", + "coordinate": "L5", + "item_path": "maximum_potential_return_type/value", + "list_path": "investments", + "mode": "down", + "row": 5 + }, + { + "column": 13, + "column_letter": "M", + "coordinate": "M5", + "item_path": "maximum_potential_return/value", + "list_path": "investments", + "mode": "down", + "row": 5 + }, + { + "column": 14, + "column_letter": "N", + "coordinate": "N5", + "item_path": "investor_repayment/value", + "list_path": "investments", + "mode": "down", + "row": 5 + }, + { + "column": 15, + "column_letter": "O", + "coordinate": "O5", + "item_path": "investment_type/value", + "list_path": "investments", + "mode": "down", + "row": 5 + }, + { + "column": 16, + "column_letter": "P", + "coordinate": "P5", + "item_path": "source_ids", + "list_path": "investments", + "mode": "down", + "row": 5 + }, + { + "column": 17, + "column_letter": "Q", + "coordinate": "Q5", + "item_path": "notes", + "list_path": "investments", + "mode": "down", + "row": 5 + }, + { + "column": 18, + "column_letter": "R", + "coordinate": "R5", + "item_path": "status", + "list_path": "investments", + "mode": "down", + "row": 5 + } + ] + }, + "right_configs": {}, + "single_configs": {} + }, + "Open Contracting": { + "down_configs": { + "open_contracting_datas": [ + { + "column": 1, + "column_letter": "A", + "coordinate": "A4", + "item_path": "ocid", + "list_path": "open_contracting_datas", + "mode": "down", + "row": 4 + }, + { + "column": 2, + "column_letter": "B", + "coordinate": "B4", + "item_path": "source_ids", + "list_path": "open_contracting_datas", + "mode": "down", + "row": 4 + }, + { + "column": 3, + "column_letter": "C", + "coordinate": "C4", + "item_path": "notes", + "list_path": "open_contracting_datas", + "mode": "down", + "row": 4 + }, + { + "column": 4, + "column_letter": "D", + "coordinate": "D4", + "item_path": "status", + "list_path": "open_contracting_datas", + "mode": "down", + "row": 4 + } + ] + }, + "right_configs": {}, + "single_configs": {} + }, + "Organisations": { + "down_configs": { + "organisations": [ + { + "column": 1, + "column_letter": "A", + "coordinate": "A4", + "item_path": "id", + "list_path": "organisations", + "mode": "down", + "row": 4 + }, + { + "column": 2, + "column_letter": "B", + "coordinate": "B4", + "item_path": "name/value", + "list_path": "organisations", + "mode": "down", + "row": 4 + }, + { + "column": 3, + "column_letter": "C", + "coordinate": "C4", + "item_path": "org-ids/company/value", + "list_path": "organisations", + "mode": "down", + "row": 4 + }, + { + "column": 4, + "column_letter": "D", + "coordinate": "D4", + "item_path": "org-ids/charity/value", + "list_path": "organisations", + "mode": "down", + "row": 4 + }, + { + "column": 5, + "column_letter": "E", + "coordinate": "E4", + "item_path": "org-ids/other/value", + "list_path": "organisations", + "mode": "down", + "row": 4 + }, + { + "column": 6, + "column_letter": "F", + "coordinate": "F4", + "item_path": "contact/name/value", + "list_path": "organisations", + "mode": "down", + "row": 4 + }, + { + "column": 7, + "column_letter": "G", + "coordinate": "G4", + "item_path": "contact/email/value", + "list_path": "organisations", + "mode": "down", + "row": 4 + }, + { + "column": 8, + "column_letter": "H", + "coordinate": "H4", + "item_path": "website/value", + "list_path": "organisations", + "mode": "down", + "row": 4 + }, + { + "column": 9, + "column_letter": "I", + "coordinate": "I4", + "item_path": "address/value", + "list_path": "organisations", + "mode": "down", + "row": 4 + }, + { + "column": 10, + "column_letter": "J", + "coordinate": "J4", + "item_path": "postcode/value", + "list_path": "organisations", + "mode": "down", + "row": 4 + }, + { + "column": 11, + "column_letter": "K", + "coordinate": "K4", + "item_path": "country/value", + "list_path": "organisations", + "mode": "down", + "row": 4 + } + ] + }, + "right_configs": {}, + "single_configs": {} + }, + "Outcome Funds": { + "down_configs": { + "outcome_funds": [ + { + "column": 1, + "column_letter": "A", + "coordinate": "A5", + "item_path": "id", + "list_path": "outcome_funds", + "mode": "down", + "row": 5 + }, + { + "column": 2, + "column_letter": "B", + "coordinate": "B5", + "item_path": "fund/name/value", + "list_path": "outcome_funds", + "mode": "down", + "row": 5 + }, + { + "column": 3, + "column_letter": "C", + "coordinate": "C5", + "item_path": "fund/identifier_scheme/value", + "list_path": "outcome_funds", + "mode": "down", + "row": 5 + }, + { + "column": 4, + "column_letter": "D", + "coordinate": "D5", + "item_path": "fund/identifier/value", + "list_path": "outcome_funds", + "mode": "down", + "row": 5 + }, + { + "column": 5, + "column_letter": "E", + "coordinate": "E5", + "item_path": "fund/organisation_ids/value", + "list_path": "outcome_funds", + "mode": "down", + "row": 5 + }, + { + "column": 6, + "column_letter": "F", + "coordinate": "F5", + "item_path": "fund/country/value", + "list_path": "outcome_funds", + "mode": "down", + "row": 5 + }, + { + "column": 7, + "column_letter": "G", + "coordinate": "G5", + "item_path": "source_ids", + "list_path": "outcome_funds", + "mode": "down", + "row": 5 + }, + { + "column": 8, + "column_letter": "H", + "coordinate": "H5", + "item_path": "notes", + "list_path": "outcome_funds", + "mode": "down", + "row": 5 + }, + { + "column": 9, + "column_letter": "I", + "coordinate": "I5", + "item_path": "status", + "list_path": "outcome_funds", + "mode": "down", + "row": 5 + } + ] + }, + "right_configs": {}, + "single_configs": {} + }, + "Outcome Metrics": { + "down_configs": { + "outcome_metrics": [ + { + "column": 1, + "column_letter": "A", + "coordinate": "A4", + "item_path": "id", + "list_path": "outcome_metrics", + "mode": "down", + "row": 4 + }, + { + "column": 2, + "column_letter": "B", + "coordinate": "B4", + "item_path": "definition/value", + "list_path": "outcome_metrics", + "mode": "down", + "row": 4 + }, + { + "column": 3, + "column_letter": "C", + "coordinate": "C4", + "item_path": "target_population/value", + "list_path": "outcome_metrics", + "mode": "down", + "row": 4 + }, + { + "column": 4, + "column_letter": "D", + "coordinate": "D4", + "item_path": "targeted_number_of_service_users_or_beneficiaries_total/value", + "list_path": "outcome_metrics", + "mode": "down", + "row": 4 + }, + { + "column": 5, + "column_letter": "E", + "coordinate": "E4", + "item_path": "unit_type_of_targeted_service_users_or_beneficiaries/value", + "list_path": "outcome_metrics", + "mode": "down", + "row": 4 + }, + { + "column": 6, + "column_letter": "F", + "coordinate": "F4", + "item_path": "unit_description_of_service_user_or_beneficiaries/value", + "list_path": "outcome_metrics", + "mode": "down", + "row": 4 + }, + { + "column": 7, + "column_letter": "G", + "coordinate": "G4", + "item_path": "outcome_metric_target/value", + "list_path": "outcome_metrics", + "mode": "down", + "row": 4 + }, + { + "column": 8, + "column_letter": "H", + "coordinate": "H4", + "item_path": "other_target_for_meeting_outcome_metric_target/value", + "list_path": "outcome_metrics", + "mode": "down", + "row": 4 + }, + { + "column": 9, + "column_letter": "I", + "coordinate": "I4", + "item_path": "outcome_validation_method/value", + "list_path": "outcome_metrics", + "mode": "down", + "row": 4 + }, + { + "column": 10, + "column_letter": "J", + "coordinate": "J4", + "item_path": "data_source_for_outcome_validation/value", + "list_path": "outcome_metrics", + "mode": "down", + "row": 4 + }, + { + "column": 11, + "column_letter": "K", + "coordinate": "K4", + "item_path": "policy_sector/value", + "list_path": "outcome_metrics", + "mode": "down", + "row": 4 + }, + { + "column": 12, + "column_letter": "L", + "coordinate": "L4", + "item_path": "primary_sdg_goal/value", + "list_path": "outcome_metrics", + "mode": "down", + "row": 4 + }, + { + "column": 13, + "column_letter": "M", + "coordinate": "M4", + "item_path": "secondary_sdg_goals/value", + "list_path": "outcome_metrics", + "mode": "down", + "row": 4 + }, + { + "column": 14, + "column_letter": "N", + "coordinate": "N4", + "item_path": "primary_sdg_target/value", + "list_path": "outcome_metrics", + "mode": "down", + "row": 4 + }, + { + "column": 15, + "column_letter": "O", + "coordinate": "O4", + "item_path": "secondary_sdg_targets/value", + "list_path": "outcome_metrics", + "mode": "down", + "row": 4 + }, + { + "column": 16, + "column_letter": "P", + "coordinate": "P4", + "item_path": "source_ids", + "list_path": "outcome_metrics", + "mode": "down", + "row": 4 + }, + { + "column": 17, + "column_letter": "Q", + "coordinate": "Q4", + "item_path": "notes", + "list_path": "outcome_metrics", + "mode": "down", + "row": 4 + }, + { + "column": 18, + "column_letter": "R", + "coordinate": "R4", + "item_path": "status", + "list_path": "outcome_metrics", + "mode": "down", + "row": 4 + } + ] + }, + "right_configs": {}, + "single_configs": {} + }, + "Outcome Payment Commitments": { + "down_configs": { + "outcome_payment_commitments": [ + { + "column": 1, + "column_letter": "A", + "coordinate": "A4", + "item_path": "organisation_id/value", + "list_path": "outcome_payment_commitments", + "mode": "down", + "row": 4 + }, + { + "column": 2, + "column_letter": "B", + "coordinate": "B4", + "item_path": "organisation_role_category/value", + "list_path": "outcome_payment_commitments", + "mode": "down", + "row": 4 + }, + { + "column": 3, + "column_letter": "C", + "coordinate": "C4", + "item_path": "maximum_potential_outcome_payment/currency/value", + "list_path": "outcome_payment_commitments", + "mode": "down", + "row": 4 + }, + { + "column": 4, + "column_letter": "D", + "coordinate": "D4", + "item_path": "maximum_potential_outcome_payment/amount/value", + "list_path": "outcome_payment_commitments", + "mode": "down", + "row": 4 + }, + { + "column": 5, + "column_letter": "E", + "coordinate": "E4", + "item_path": "maximum_potential_outcome_payment/amount_usd/value", + "list_path": "outcome_payment_commitments", + "mode": "down", + "row": 4 + }, + { + "column": 6, + "column_letter": "F", + "coordinate": "F4", + "item_path": "result_type/value", + "list_path": "outcome_payment_commitments", + "mode": "down", + "row": 4 + }, + { + "column": 7, + "column_letter": "G", + "coordinate": "G4", + "item_path": "period/start_date/value", + "list_path": "outcome_payment_commitments", + "mode": "down", + "row": 4 + }, + { + "column": 8, + "column_letter": "H", + "coordinate": "H4", + "item_path": "period/end_date/value", + "list_path": "outcome_payment_commitments", + "mode": "down", + "row": 4 + }, + { + "column": 9, + "column_letter": "I", + "coordinate": "I4", + "item_path": "total_outcome_payments/currency/value", + "list_path": "outcome_payment_commitments", + "mode": "down", + "row": 4 + }, + { + "column": 10, + "column_letter": "J", + "coordinate": "J4", + "item_path": "total_outcome_payments/amount/value", + "list_path": "outcome_payment_commitments", + "mode": "down", + "row": 4 + }, + { + "column": 11, + "column_letter": "K", + "coordinate": "K4", + "item_path": "total_outcome_payments/amount_usd/value", + "list_path": "outcome_payment_commitments", + "mode": "down", + "row": 4 + }, + { + "column": 12, + "column_letter": "L", + "coordinate": "L4", + "item_path": "alterations/description/value", + "list_path": "outcome_payment_commitments", + "mode": "down", + "row": 4 + }, + { + "column": 13, + "column_letter": "M", + "coordinate": "M4", + "item_path": "alterations/reason/value", + "list_path": "outcome_payment_commitments", + "mode": "down", + "row": 4 + }, + { + "column": 14, + "column_letter": "N", + "coordinate": "N4", + "item_path": "source_ids", + "list_path": "outcome_payment_commitments", + "mode": "down", + "row": 4 + }, + { + "column": 15, + "column_letter": "O", + "coordinate": "O4", + "item_path": "notes", + "list_path": "outcome_payment_commitments", + "mode": "down", + "row": 4 + }, + { + "column": 16, + "column_letter": "P", + "coordinate": "P4", + "item_path": "status", + "list_path": "outcome_payment_commitments", + "mode": "down", + "row": 4 + } + ] + }, + "right_configs": {}, + "single_configs": {} + }, + "Outcome Pricing": { + "down_configs": { + "outcome_pricings": [ + { + "column": 1, + "column_letter": "A", + "coordinate": "A5", + "item_path": "outcome_metric_id/value", + "list_path": "outcome_pricings", + "mode": "down", + "row": 5 + }, + { + "column": 2, + "column_letter": "B", + "coordinate": "B5", + "item_path": "currency/value", + "list_path": "outcome_pricings", + "mode": "down", + "row": 5 + }, + { + "column": 3, + "column_letter": "C", + "coordinate": "C5", + "item_path": "price_per_unit/amount/value", + "list_path": "outcome_pricings", + "mode": "down", + "row": 5 + }, + { + "column": 4, + "column_letter": "D", + "coordinate": "D5", + "item_path": "price_per_unit/amount_usd/value", + "list_path": "outcome_pricings", + "mode": "down", + "row": 5 + }, + { + "column": 5, + "column_letter": "E", + "coordinate": "E5", + "item_path": "maximum_price_if_all_targets_achieved/amount/value", + "list_path": "outcome_pricings", + "mode": "down", + "row": 5 + }, + { + "column": 6, + "column_letter": "F", + "coordinate": "F5", + "item_path": "contracted_increases_to_outcome_pricing/value", + "list_path": "outcome_pricings", + "mode": "down", + "row": 5 + }, + { + "column": 7, + "column_letter": "G", + "coordinate": "G5", + "item_path": "price_description/value", + "list_path": "outcome_pricings", + "mode": "down", + "row": 5 + }, + { + "column": 8, + "column_letter": "H", + "coordinate": "H5", + "item_path": "source_ids", + "list_path": "outcome_pricings", + "mode": "down", + "row": 5 + }, + { + "column": 9, + "column_letter": "I", + "coordinate": "I5", + "item_path": "notes", + "list_path": "outcome_pricings", + "mode": "down", + "row": 5 + }, + { + "column": 10, + "column_letter": "J", + "coordinate": "J5", + "item_path": "status", + "list_path": "outcome_pricings", + "mode": "down", + "row": 5 + } + ] + }, + "right_configs": {}, + "single_configs": {} + }, + "Results": { + "down_configs": { + "results": [ + { + "column": 1, + "column_letter": "A", + "coordinate": "A5", + "item_path": "outcome_metric_id/value", + "list_path": "results", + "mode": "down", + "row": 5 + }, + { + "column": 2, + "column_letter": "B", + "coordinate": "B5", + "item_path": "result_level/value", + "list_path": "results", + "mode": "down", + "row": 5 + }, + { + "column": 3, + "column_letter": "C", + "coordinate": "C5", + "item_path": "result_type/value", + "list_path": "results", + "mode": "down", + "row": 5 + }, + { + "column": 4, + "column_letter": "D", + "coordinate": "D5", + "item_path": "period/start_date/value", + "list_path": "results", + "mode": "down", + "row": 5 + }, + { + "column": 5, + "column_letter": "E", + "coordinate": "E5", + "item_path": "period/end_date/value", + "list_path": "results", + "mode": "down", + "row": 5 + }, + { + "column": 6, + "column_letter": "F", + "coordinate": "F5", + "item_path": "outcomes_achieved/value", + "list_path": "results", + "mode": "down", + "row": 5 + }, + { + "column": 7, + "column_letter": "G", + "coordinate": "G5", + "item_path": "number_engaged_in_impact_bond/value", + "list_path": "results", + "mode": "down", + "row": 5 + }, + { + "column": 8, + "column_letter": "H", + "coordinate": "H5", + "item_path": "number_with_positive_social_outcomes/value", + "list_path": "results", + "mode": "down", + "row": 5 + }, + { + "column": 9, + "column_letter": "I", + "coordinate": "I5", + "item_path": "other_description_of_result/value", + "list_path": "results", + "mode": "down", + "row": 5 + }, + { + "column": 10, + "column_letter": "J", + "coordinate": "J5", + "item_path": "outcomes_validator_organisation_ids/value", + "list_path": "results", + "mode": "down", + "row": 5 + }, + { + "column": 11, + "column_letter": "K", + "coordinate": "K5", + "item_path": "evaluation_documents_source_ids/value", + "list_path": "results", + "mode": "down", + "row": 5 + }, + { + "column": 12, + "column_letter": "L", + "coordinate": "L5", + "item_path": "source_ids", + "list_path": "results", + "mode": "down", + "row": 5 + }, + { + "column": 13, + "column_letter": "M", + "coordinate": "M5", + "item_path": "notes", + "list_path": "results", + "mode": "down", + "row": 5 + }, + { + "column": 14, + "column_letter": "N", + "coordinate": "N5", + "item_path": "status", + "list_path": "results", + "mode": "down", + "row": 5 + } + ] + }, + "right_configs": {}, + "single_configs": {} + }, + "Service Provisions": { + "down_configs": { + "service_provisions": [ + { + "column": 1, + "column_letter": "A", + "coordinate": "A4", + "item_path": "id", + "list_path": "service_provisions", + "mode": "down", + "row": 4 + }, + { + "column": 2, + "column_letter": "B", + "coordinate": "B4", + "item_path": "organisation_id/value", + "list_path": "service_provisions", + "mode": "down", + "row": 4 + }, + { + "column": 3, + "column_letter": "C", + "coordinate": "C4", + "item_path": "organisation_role_category/value", + "list_path": "service_provisions", + "mode": "down", + "row": 4 + }, + { + "column": 4, + "column_letter": "D", + "coordinate": "D4", + "item_path": "intervention/value", + "list_path": "service_provisions", + "mode": "down", + "row": 4 + }, + { + "column": 5, + "column_letter": "E", + "coordinate": "E4", + "item_path": "planned_service/start_date/value", + "list_path": "service_provisions", + "mode": "down", + "row": 4 + }, + { + "column": 6, + "column_letter": "F", + "coordinate": "F4", + "item_path": "planned_service/end_date/value", + "list_path": "service_provisions", + "mode": "down", + "row": 4 + }, + { + "column": 7, + "column_letter": "G", + "coordinate": "G4", + "item_path": "actual_service/start_date/value", + "list_path": "service_provisions", + "mode": "down", + "row": 4 + }, + { + "column": 8, + "column_letter": "H", + "coordinate": "H4", + "item_path": "actual_service/end_date/value", + "list_path": "service_provisions", + "mode": "down", + "row": 4 + }, + { + "column": 9, + "column_letter": "I", + "coordinate": "I4", + "item_path": "alterations/description/value", + "list_path": "service_provisions", + "mode": "down", + "row": 4 + }, + { + "column": 10, + "column_letter": "J", + "coordinate": "J4", + "item_path": "alterations/reason/value", + "list_path": "service_provisions", + "mode": "down", + "row": 4 + }, + { + "column": 11, + "column_letter": "K", + "coordinate": "K4", + "item_path": "source_ids", + "list_path": "service_provisions", + "mode": "down", + "row": 4 + }, + { + "column": 12, + "column_letter": "L", + "coordinate": "L4", + "item_path": "notes", + "list_path": "service_provisions", + "mode": "down", + "row": 4 + }, + { + "column": 13, + "column_letter": "M", + "coordinate": "M4", + "item_path": "status", + "list_path": "service_provisions", + "mode": "down", + "row": 4 + } + ] + }, + "right_configs": {}, + "single_configs": {} + }, + "Sources": { + "down_configs": { + "sources": [ + { + "column": 1, + "column_letter": "A", + "coordinate": "A4", + "item_path": "id", + "list_path": "sources", + "mode": "down", + "row": 4 + }, + { + "column": 2, + "column_letter": "B", + "coordinate": "B4", + "item_path": "name/value", + "list_path": "sources", + "mode": "down", + "row": 4 + }, + { + "column": 3, + "column_letter": "C", + "coordinate": "C4", + "item_path": "type/value", + "list_path": "sources", + "mode": "down", + "row": 4 + }, + { + "column": 4, + "column_letter": "D", + "coordinate": "D4", + "item_path": "publishing_organisation_ids/value", + "list_path": "sources", + "mode": "down", + "row": 4 + }, + { + "column": 5, + "column_letter": "E", + "coordinate": "E4", + "item_path": "url/value", + "list_path": "sources", + "mode": "down", + "row": 4 + }, + { + "column": 6, + "column_letter": "F", + "coordinate": "F4", + "item_path": "archive_url/value", + "list_path": "sources", + "mode": "down", + "row": 4 + }, + { + "column": 7, + "column_letter": "G", + "coordinate": "G4", + "item_path": "internal_url/value", + "list_path": "sources", + "mode": "down", + "row": 4 + }, + { + "column": 8, + "column_letter": "H", + "coordinate": "H4", + "item_path": "publication_date/value", + "list_path": "sources", + "mode": "down", + "row": 4 + }, + { + "column": 9, + "column_letter": "I", + "coordinate": "I4", + "item_path": "accessed_date/value", + "list_path": "sources", + "mode": "down", + "row": 4 + }, + { + "column": 10, + "column_letter": "J", + "coordinate": "J4", + "item_path": "notes", + "list_path": "sources", + "mode": "down", + "row": 4 + }, + { + "column": 11, + "column_letter": "K", + "coordinate": "K4", + "item_path": "status", + "list_path": "sources", + "mode": "down", + "row": 4 + } + ] + }, + "right_configs": {}, + "single_configs": {} + }, + "TechAssistDetsCategoryOptions": { + "down_configs": {}, + "right_configs": {}, + "single_configs": {} + }, + "Technical Assistance": { + "down_configs": { + "technical_assistances": [ + { + "column": 1, + "column_letter": "A", + "coordinate": "A5", + "item_path": "id", + "list_path": "technical_assistances", + "mode": "down", + "row": 5 + }, + { + "column": 2, + "column_letter": "B", + "coordinate": "B5", + "item_path": "title/value", + "list_path": "technical_assistances", + "mode": "down", + "row": 5 + }, + { + "column": 3, + "column_letter": "C", + "coordinate": "C5", + "item_path": "description/value", + "list_path": "technical_assistances", + "mode": "down", + "row": 5 + }, + { + "column": 4, + "column_letter": "D", + "coordinate": "D5", + "item_path": "period_start/value", + "list_path": "technical_assistances", + "mode": "down", + "row": 5 + }, + { + "column": 5, + "column_letter": "E", + "coordinate": "E5", + "item_path": "period_end/value", + "list_path": "technical_assistances", + "mode": "down", + "row": 5 + }, + { + "column": 6, + "column_letter": "F", + "coordinate": "F5", + "item_path": "funding_organisation_id/value", + "list_path": "technical_assistances", + "mode": "down", + "row": 5 + }, + { + "column": 7, + "column_letter": "G", + "coordinate": "G5", + "item_path": "recipient_organisation_id/value", + "list_path": "technical_assistances", + "mode": "down", + "row": 5 + }, + { + "column": 8, + "column_letter": "H", + "coordinate": "H5", + "item_path": "currency/value", + "list_path": "technical_assistances", + "mode": "down", + "row": 5 + }, + { + "column": 9, + "column_letter": "I", + "coordinate": "I5", + "item_path": "source_ids", + "list_path": "technical_assistances", + "mode": "down", + "row": 5 + }, + { + "column": 10, + "column_letter": "J", + "coordinate": "J5", + "item_path": "notes", + "list_path": "technical_assistances", + "mode": "down", + "row": 5 + }, + { + "column": 11, + "column_letter": "K", + "coordinate": "K5", + "item_path": "status", + "list_path": "technical_assistances", + "mode": "down", + "row": 5 + } + ] + }, + "right_configs": {}, + "single_configs": {} + }, + "Technical Assistance Details": { + "down_configs": { + "technical_assistance_details": [ + { + "column": 1, + "column_letter": "A", + "coordinate": "A5", + "item_path": "technical_assistance_id/value", + "list_path": "technical_assistance_details", + "mode": "down", + "row": 5 + }, + { + "column": 2, + "column_letter": "B", + "coordinate": "B5", + "item_path": "title/value", + "list_path": "technical_assistance_details", + "mode": "down", + "row": 5 + }, + { + "column": 3, + "column_letter": "C", + "coordinate": "C5", + "item_path": "description/value", + "list_path": "technical_assistance_details", + "mode": "down", + "row": 5 + }, + { + "column": 4, + "column_letter": "D", + "coordinate": "D5", + "item_path": "category/value", + "list_path": "technical_assistance_details", + "mode": "down", + "row": 5 + }, + { + "column": 5, + "column_letter": "E", + "coordinate": "E5", + "item_path": "approach/value", + "list_path": "technical_assistance_details", + "mode": "down", + "row": 5 + }, + { + "column": 6, + "column_letter": "F", + "coordinate": "F5", + "item_path": "cost_type/value", + "list_path": "technical_assistance_details", + "mode": "down", + "row": 5 + }, + { + "column": 7, + "column_letter": "G", + "coordinate": "G5", + "item_path": "cost_of_activities/amount/value", + "list_path": "technical_assistance_details", + "mode": "down", + "row": 5 + }, + { + "column": 8, + "column_letter": "H", + "coordinate": "H5", + "item_path": "cost_of_activities/amount_usd/value", + "list_path": "technical_assistance_details", + "mode": "down", + "row": 5 + }, + { + "column": 9, + "column_letter": "I", + "coordinate": "I5", + "item_path": "number_of_days/value", + "list_path": "technical_assistance_details", + "mode": "down", + "row": 5 + }, + { + "column": 10, + "column_letter": "J", + "coordinate": "J5", + "item_path": "source_ids", + "list_path": "technical_assistance_details", + "mode": "down", + "row": 5 + }, + { + "column": 11, + "column_letter": "K", + "coordinate": "K5", + "item_path": "notes", + "list_path": "technical_assistance_details", + "mode": "down", + "row": 5 + }, + { + "column": 12, + "column_letter": "L", + "coordinate": "L5", + "item_path": "status", + "list_path": "technical_assistance_details", + "mode": "down", + "row": 5 + } + ] + }, + "right_configs": {}, + "single_configs": {} + }, + "Transactions": { + "down_configs": { + "transactions": [ + { + "column": 1, + "column_letter": "A", + "coordinate": "A5", + "item_path": "investment_id/value", + "list_path": "transactions", + "mode": "down", + "row": 5 + }, + { + "column": 2, + "column_letter": "B", + "coordinate": "B5", + "item_path": "outcome_metric_id/value", + "list_path": "transactions", + "mode": "down", + "row": 5 + }, + { + "column": 3, + "column_letter": "C", + "coordinate": "C5", + "item_path": "grant_id/value", + "list_path": "transactions", + "mode": "down", + "row": 5 + }, + { + "column": 4, + "column_letter": "D", + "coordinate": "D5", + "item_path": "date/value", + "list_path": "transactions", + "mode": "down", + "row": 5 + }, + { + "column": 5, + "column_letter": "E", + "coordinate": "E5", + "item_path": "sending_organisation_id/value", + "list_path": "transactions", + "mode": "down", + "row": 5 + }, + { + "column": 6, + "column_letter": "F", + "coordinate": "F5", + "item_path": "receiving_organisation_id/value", + "list_path": "transactions", + "mode": "down", + "row": 5 + }, + { + "column": 7, + "column_letter": "G", + "coordinate": "G5", + "item_path": "transaction_type/value", + "list_path": "transactions", + "mode": "down", + "row": 5 + }, + { + "column": 8, + "column_letter": "H", + "coordinate": "H5", + "item_path": "money/currency/value", + "list_path": "transactions", + "mode": "down", + "row": 5 + }, + { + "column": 9, + "column_letter": "I", + "coordinate": "I5", + "item_path": "money/amount/value", + "list_path": "transactions", + "mode": "down", + "row": 5 + }, + { + "column": 10, + "column_letter": "J", + "coordinate": "J5", + "item_path": "money/amount_usd/value", + "list_path": "transactions", + "mode": "down", + "row": 5 + }, + { + "column": 11, + "column_letter": "K", + "coordinate": "K5", + "item_path": "source_ids", + "list_path": "transactions", + "mode": "down", + "row": 5 + }, + { + "column": 12, + "column_letter": "L", + "coordinate": "L5", + "item_path": "notes", + "list_path": "transactions", + "mode": "down", + "row": 5 + }, + { + "column": 13, + "column_letter": "M", + "coordinate": "M5", + "item_path": "status", + "list_path": "transactions", + "mode": "down", + "row": 5 + }, + { + "column": 14, + "column_letter": "N", + "coordinate": "N5", + "item_path": "sandboxes", + "list_path": "transactions", + "mode": "down", + "row": 5 + } + ] + }, + "right_configs": {}, + "single_configs": {} + } + } +} \ No newline at end of file diff --git a/indigo/spreadsheetform_guides/project_v010.xlsx b/indigo/spreadsheetform_guides/project_v010.xlsx new file mode 100644 index 0000000..4d923dc Binary files /dev/null and b/indigo/spreadsheetform_guides/project_v010.xlsx differ diff --git a/indigo/templates/indigo/admin/index.html b/indigo/templates/indigo/admin/index.html index 5b80e4e..82c043e 100644 --- a/indigo/templates/indigo/admin/index.html +++ b/indigo/templates/indigo/admin/index.html @@ -17,5 +17,6 @@

Projects

Organisations

Funds

+

Sandboxes

{% endblock %} diff --git a/indigo/templates/indigo/admin/sandbox/index.html b/indigo/templates/indigo/admin/sandbox/index.html new file mode 100644 index 0000000..c842d0d --- /dev/null +++ b/indigo/templates/indigo/admin/sandbox/index.html @@ -0,0 +1,26 @@ +{% extends 'indigo/base-admin.html' %} + +{% block head_title %}Sandbox {{ sandbox.public_id }}{% endblock %} + +{% block breadcrumbs %} + +{% endblock %} + + + +{% block content %} + +

Sandbox {{ sandbox.public_id }}

+ + + + +
ID{{ sandbox.public_id }}
Title{{ sandbox.title }}
+ +{% endblock %} diff --git a/indigo/templates/indigo/admin/sandboxes.html b/indigo/templates/indigo/admin/sandboxes.html new file mode 100644 index 0000000..20c3776 --- /dev/null +++ b/indigo/templates/indigo/admin/sandboxes.html @@ -0,0 +1,36 @@ +{% extends 'indigo/base-admin.html' %} + +{% block head_title %}Sandboxes{% endblock %} + +{% block breadcrumbs %} + +{% endblock %} + +{% block content %} + + {% if sandboxes %} + + + + + + + {% for sandbox in sandboxes %} + + + + + + + {% endfor %} +
IDName 
{{ sandbox.public_id }}{{ sandbox.title }}View
+ {% else %} +

No sandboxes are available.

+ {% endif %} + +{% endblock %} diff --git a/indigo/tests/test_updatedata_get_sandbox_only_data.py b/indigo/tests/test_updatedata_get_sandbox_only_data.py new file mode 100644 index 0000000..a320fb3 --- /dev/null +++ b/indigo/tests/test_updatedata_get_sandbox_only_data.py @@ -0,0 +1,112 @@ +from django.test import TestCase # noqa + +from indigo.updatedata import get_sandbox_only_data + + +class UpdateDataGetSandBoxOnlyData(TestCase): + def test_key_public(self): + + input = { + "name": {"value": "Project With Ferrets", "status": "PUBLIC"}, + "alt_names": {"value": "Cool", "status": ""}, + } + + out = get_sandbox_only_data(input, keys_with_own_status_subfield=["/name"]) + + assert {} == out + + def test_key_sandbox(self): + + input = { + "name": { + "value": "Project With Ferrets", + "status": "SANDBOX", + "sandboxes": "sandbox1", + }, + "alt_names": {"value": "Cool", "status": ""}, + } + + out = get_sandbox_only_data(input, keys_with_own_status_subfield=["/name"]) + + assert { + "sandbox1": { + "name": { + "value": "Project With Ferrets", + "status": None, + "sandboxes": None, + } + } + } == out + + def test_list_public(self): + + input = { + "name": {"value": "Project With Ferrets", "status": ""}, + "alt_names": [{"value": "Cool", "status": "PUBLIC"},], + } + + out = get_sandbox_only_data( + input, lists_with_items_with_own_status_subfield=["/alt_names"] + ) + + assert {} == out + + def test_list_sandbox(self): + + input = { + "name": {"value": "Project With Ferrets", "status": ""}, + "alt_names": [ + {"value": "Cool", "status": "SANDBOX", "sandboxes": "sandbox1"}, + ], + } + + out = get_sandbox_only_data( + input, lists_with_items_with_own_status_subfield=["/alt_names"] + ) + + assert {"sandbox1": {"alt_names": [{"value": "Cool"}]}} == out + + def test_list_sandbox_complex(self): + + input = { + "name": {"value": "Project With Ferrets", "status": ""}, + "alt_names": [ + {"value": "Cool", "status": "SANDBOX", "sandboxes": "sandbox1"}, + ], + "organisations": [ + { + "value": "Linda's Ferret Sanctuary", + "status": "SANDBOX", + "sandboxes": "sandbox1", + }, + { + "value": "Bob's Free-range Ferrets", + "status": "SANDBOX", + "sandboxes": "sandbox2", + }, + { + "value": "Jeff's Ferret Zoo", + "status": "SANDBOX", + "sandboxes": "sandbox2, sandbox3", + }, + ], + } + + out = get_sandbox_only_data( + input, + lists_with_items_with_own_status_subfield=["/alt_names", "/organisations"], + ) + + assert { + "sandbox1": { + "alt_names": [{"value": "Cool"}], + "organisations": [{"value": "Linda's Ferret Sanctuary"}], + }, + "sandbox2": { + "organisations": [ + {"value": "Bob's Free-range Ferrets"}, + {"value": "Jeff's Ferret Zoo"}, + ] + }, + "sandbox3": {"organisations": [{"value": "Jeff's Ferret Zoo"}]}, + } == out diff --git a/indigo/updatedata.py b/indigo/updatedata.py index 9e4745a..d7c1294 100644 --- a/indigo/updatedata.py +++ b/indigo/updatedata.py @@ -97,6 +97,14 @@ def update_project( ) else: project.data_public = {} + # Sandbox Data + project.data_sandboxes = get_sandbox_only_data( + record.cached_data, + keys_with_own_status_subfield=settings.JSONDATAFERRET_TYPE_INFORMATION.get( + "project" + ).get("filter_keys"), + lists_with_items_with_own_status_subfield=TYPE_PROJECT_FILTER_LISTS_LIST, + ) # Private Data if record.cached_exists: project.data_private = indigo.processdata.add_other_records_to_project( @@ -325,6 +333,68 @@ def filter_values( return data +def get_sandbox_only_data( + data, + keys_with_own_status_subfield=[], + lists_with_items_with_own_status_subfield=[], +): + sandbox_data = {} + + # Some single values (or groups of single values) wight be removed, based on a status field. + for key in keys_with_own_status_subfield: + try: + key_data = jsonpointer.resolve_pointer(data, key) + except jsonpointer.JsonPointerException: + # Data does not exist anyway, nothing to do! + continue + key_status = key_data.get("status", "") if isinstance(key_data, dict) else "" + if isinstance(key_status, str) and key_status.strip().lower() == "sandbox": + for sandbox in [ + i.strip() for i in key_data.get("sandboxes", "").split(",") if i.strip() + ]: + if sandbox not in sandbox_data: + sandbox_data[sandbox] = {} + jsonpointer.set_pointer(sandbox_data[sandbox], key, key_data) + jsonpointer.set_pointer(sandbox_data[sandbox], key + "/status", None) + jsonpointer.set_pointer(sandbox_data[sandbox], key + "/sandboxes", None) + + # Some lists have items with a status field, which we might remove + for list_key in lists_with_items_with_own_status_subfield: + try: + old_list = jsonpointer.resolve_pointer(data, list_key) + except jsonpointer.JsonPointerException: + # Data does not exist anyway, nothing to do! + continue + if isinstance(old_list, list) and old_list: + new_lists = {} + for item in old_list: + key_status = item.get("status", "") if isinstance(item, dict) else "" + if ( + isinstance(key_status, str) + and key_status.strip().lower() == "sandbox" + ): + new_item = copy.deepcopy(item) + if "status" in new_item: + del new_item["status"] + if "sandboxes" in new_item: + del new_item["sandboxes"] + for sandbox in [ + i.strip() + for i in item.get("sandboxes", "").split(",") + if i.strip() + ]: + if sandbox not in new_lists: + new_lists[sandbox] = [] + new_lists[sandbox].append(new_item) + for sandbox, new_list in new_lists.items(): + if sandbox not in sandbox_data: + sandbox_data[sandbox] = {} + jsonpointer.set_pointer(sandbox_data[sandbox], list_key, new_list) + + # Done + return sandbox_data + + def map_project_values(data): data = copy.deepcopy(data) diff --git a/indigo/urls.py b/indigo/urls.py index 3b6b447..de0b521 100644 --- a/indigo/urls.py +++ b/indigo/urls.py @@ -265,6 +265,15 @@ name="indigo_admin_fund_history", ), path("admin/new_fund", views.AdminFundNew.as_view(), name="indigo_admin_fund_new",), + ########################### Admin - Sandboxes + path( + "admin/sandboxes", views.admin_sandbox_list, name="indigo_admin_sandbox_list", + ), + path( + "admin/sandbox/", + views.admin_sandbox_index, + name="indigo_admin_sandbox_index", + ), ########################### Admin - Event path( "admin/event/", diff --git a/indigo/views.py b/indigo/views.py index ad39f04..dd813fc 100755 --- a/indigo/views.py +++ b/indigo/views.py @@ -43,7 +43,7 @@ ProjectNewForm, RecordChangeStatusForm, ) -from .models import Fund, Organisation, Project, ProjectImport +from .models import Fund, Organisation, Project, ProjectImport, Sandbox ########################### Home Page @@ -412,6 +412,12 @@ def api1_project_index(request, public_id): raise Http404("Project does not exist") data = {"project": {"id": project.public_id, "data": project.data_public,}} + if ( + settings.API_SANDBOX_DATA_PASSWORD + and request.GET.get("sandbox_data_password", "") + == settings.API_SANDBOX_DATA_PASSWORD + ): + data["sandboxes"] = project.data_sandboxes return JsonResponse(data) @@ -1843,6 +1849,24 @@ class AdminFundHistory(AdminModelHistory): _type_public_id = TYPE_FUND_PUBLIC_ID +########################### Admin - sandboxes + + +@permission_required("indigo.admin") +def admin_sandbox_list(request): + sandboxes = Sandbox.objects.all() + return render(request, "indigo/admin/sandboxes.html", {"sandboxes": sandboxes},) + + +@permission_required("indigo.admin") +def admin_sandbox_index(request, public_id): + try: + sandbox = Sandbox.objects.get(public_id=public_id) + except Sandbox.DoesNotExist: + raise Http404("Sandbox does not exist") + return render(request, "indigo/admin/sandbox/index.html", {"sandbox": sandbox},) + + ########################### Admin - Event