Handle BooleanFields in Person
This commit is contained in:
parent
026692b9b2
commit
20b1ac2e7d
1 changed files with 9 additions and 0 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue