Handle BooleanFields in Person

This commit is contained in:
PCoder 2021-11-22 19:21:03 +05:30
parent 026692b9b2
commit 20b1ac2e7d

View file

@ -354,6 +354,15 @@ class Command(BaseCommand):
_object_dict['organization_id'] = '-1' _object_dict['organization_id'] = '-1'
else: else:
_object_dict['organization_id'] = int(float(_object_dict['organization_id'])) _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) print(_object_dict)
if _object_dict is None: if _object_dict is None:
print("Object None for %s" % model_name) print("Object None for %s" % model_name)