Set status to PeopleStatus instance

This commit is contained in:
PCoder 2021-11-22 19:48:36 +05:30
parent a35e6153a8
commit 0f3497ce28

View file

@ -3,6 +3,8 @@ from django.apps import apps
from django.db.utils import IntegrityError from django.db.utils import IntegrityError
from app.models import *
import csv import csv
import json import json
@ -405,6 +407,9 @@ def handle_object_dict(object_dict, model_name):
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']))
if 'status' in object_dict:
print('Getting status of %s' % object_dict['status'])
object_dict['status'] = PeopleStatus.objects.get(int(object_dict['status']))
for i in ['news_letter', 'birds', 'mammals', 'reptiles', 'amphibians', 'fish', 'insects', for i in ['news_letter', 'birds', 'mammals', 'reptiles', 'amphibians', 'fish', 'insects',
'molluscs', 'crustaceans', 'arachnids', 'angiosperms', 'gymnosperms', 'fungi', 'molluscs', 'crustaceans', 'arachnids', 'angiosperms', 'gymnosperms', 'fungi',
'algae', 'microbes', 'biological_field_sampling', 'data_mining', 'remote_sensing', 'algae', 'microbes', 'biological_field_sampling', 'data_mining', 'remote_sensing',