From 20b1ac2e7d7286254fcc6c047c95239c938051d2 Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 22 Nov 2021 19:21:03 +0530 Subject: [PATCH] Handle BooleanFields in Person --- app/management/commands/import.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/management/commands/import.py b/app/management/commands/import.py index 3dd0031..5a55c88 100644 --- a/app/management/commands/import.py +++ b/app/management/commands/import.py @@ -354,6 +354,15 @@ class Command(BaseCommand): _object_dict['organization_id'] = '-1' else: _object_dict['organization_id'] = int(float(_object_dict['organization_id'])) + for i in ['news_letter', 'birds', 'mammals', 'reptiles', 'amphibians', 'fish', 'insects', + 'molluscs', 'crustaceans', 'arachnids', 'angiosperms', 'gymnosperms', 'fungi', + 'algae', 'microbes', 'biological_field_sampling', 'data_mining', 'remote_sensing', + 'gis', 'spatial_analysis', 'statistical_analysis', 'modelling', 'assessment', + 'meta_analysis', 'synthesis', 'qualitative_ssm', 'genetic_analyses', 'field_site', + 'transect', 'mountain_top', 'mountain_range', 'landscape', 'regional', 'national', + '_global', 'profile_on_web', 'updated']: + if i in _object_dict: + _object_dict[i] = True if _object_dict[i].lower().strip() == 'true' else False print(_object_dict) if _object_dict is None: print("Object None for %s" % model_name)