@@ -90,6 +90,7 @@ def write_projects_reports_to_csv(monthly_progress_report, response):
90
90
"currency" ,
91
91
"updated_at" ,
92
92
"created_at" ,
93
+ "safe_spaces_for_women-girls" ,
93
94
]
94
95
disaggregation_cols = []
95
96
disaggregations = Disaggregation .objects .all ()
@@ -248,6 +249,7 @@ def write_projects_reports_to_csv(monthly_progress_report, response):
248
249
plan_report .currency .name if plan_report .currency else None ,
249
250
project_reports .created_at .astimezone (datetime .timezone .utc ).replace (tzinfo = None ),
250
251
project_reports .updated_at .astimezone (datetime .timezone .utc ).replace (tzinfo = None ),
252
+ "Yes" if location_report .safe_space else None ,
251
253
]
252
254
253
255
# Iterate through disaggregation locations and get disaggregation values
@@ -311,6 +313,7 @@ def write_import_report_template_sheet(workbook, monthly_report):
311
313
{"header" : "facility_long" , "type" : "string" , "width" : 30 },
312
314
{"header" : "non_hrp_beneficiary" , "type" : "string" , "width" : 30 },
313
315
{"header" : "hrp_beneficiary" , "type" : "string" , "width" : 30 },
316
+ {"header" : "with_safe_spaces" , "type" : "string" , "width" : 30 },
314
317
]
315
318
316
319
disaggregation_cols = []
@@ -344,6 +347,8 @@ def write_import_report_template_sheet(workbook, monthly_report):
344
347
"transfer_mc_type" : ["N" ],
345
348
"transfer_category" : ["L" ],
346
349
"currency" : ["M" ],
350
+ "safe_space" : ["AG" , "True" , "False" ],
351
+ "facilitySiteTypeList" : ["Z" ],
347
352
}
348
353
plain_dictionary_lists = {
349
354
"indicatorList" : ["B" ],
@@ -355,7 +360,6 @@ def write_import_report_template_sheet(workbook, monthly_report):
355
360
"admin1nameList" : ["U" ],
356
361
"admin2pcodeList" : ["V" ],
357
362
"admin2nameList" : ["W" ],
358
- "facilitySiteTypeList" : ["Z" ],
359
363
"implementing_partner_list" : ["F" ],
360
364
"non_hrp_beneficiary" : ["AE" ],
361
365
"hrp_beneficiary" : ["AF" ],
@@ -370,11 +374,14 @@ def write_import_report_template_sheet(workbook, monthly_report):
370
374
container_dictionary ["transfer_mc_type" ].extend (list (TransferMechanismType .objects .values_list ("name" , flat = True )))
371
375
container_dictionary ["transfer_category" ].extend (list (TransferCategory .objects .values_list ("name" , flat = True )))
372
376
container_dictionary ["currency" ].extend (list (Currency .objects .values_list ("name" , flat = True )))
373
- facility = list (FacilitySiteType .objects .values_list ("name" , flat = True ))
377
+ facility = list (FacilitySiteType .objects .filter ( cluster__code = "health" ). values_list ("name" , flat = True ))
374
378
responseType = list (ResponseType .objects .values_list ("name" , flat = True ))
375
379
num_rows = 2
380
+
381
+ cluster_code = []
376
382
project_code = project .code
377
383
for plan in project .activityplan_set .all ():
384
+ cluster_code .extend (plan .activity_domain .clusters .values_list ("code" , flat = True ))
378
385
for location in plan .targetlocation_set .all ():
379
386
plain_dictionary_lists ["indicatorList" ].append (str (plan .indicator .name ))
380
387
plain_dictionary_lists ["activityDomainList" ].append (str (plan .activity_domain .name ))
@@ -389,8 +396,10 @@ def write_import_report_template_sheet(workbook, monthly_report):
389
396
plain_dictionary_lists ["non_hrp_beneficiary" ].append (str (plan .beneficiary ))
390
397
plain_dictionary_lists ["hrp_beneficiary" ].append (str (plan .hrp_beneficiary ))
391
398
num_rows += 1
392
- plain_dictionary_lists [ "facilitySiteTypeList" ]. extend ( facility )
399
+
393
400
container_dictionary ["reponseTypeList" ].extend (responseType )
401
+ if "health" in cluster_code :
402
+ container_dictionary ["facilitySiteTypeList" ].extend (facility )
394
403
395
404
for key , value in container_dictionary .items ():
396
405
column = value [0 ]
0 commit comments