Handle Person import

This commit is contained in:
PCoder 2021-11-22 20:11:57 +05:30
parent 47ba92a8d1
commit fb3a7c9908

View file

@ -376,8 +376,14 @@ class Command(BaseCommand):
continue
_object_dict = {self.cols_to_django_fields.get(key): value.lstrip('"').rstrip('"') for key, value in zip(header, row)}
_object_dict = handle_object_dict(_object_dict, model_name)
m = _model(**_object_dict)
m.save()
try:
m = _model(**_object_dict)
m.save()
except Exception as ex:
print('-----')
print(str(ex))
print('----------------')
continue
print("Done importing %s" % str(_model))