cannot exclude id field during import : KeyError: u'id'
See original GitHub issueam trying to import in admin and already excluded the id field but i get
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/import_export/resources.py", line 434, in import_row
instance, new = self.get_or_init_instance(instance_loader, row)
File "/usr/local/lib/python2.7/dist-packages/import_export/resources.py", line 258, in get_or_init_instance
instance = self.get_instance(instance_loader, row)
File "/usr/local/lib/python2.7/dist-packages/import_export/resources.py", line 252, in get_instance
return instance_loader.get_instance(row)
File "/usr/local/lib/python2.7/dist-packages/import_export/instance_loaders.py", line 31, in get_instance
field = self.resource.fields[key]
KeyError: u'id'
why is it compulsory to include id field i thought it should be autogenerated
Issue Analytics
- State:
- Created 7 years ago
- Reactions:11
- Comments:6 (1 by maintainers)
Top Results From Across the Web
python - django-import-export: cannot exclude id field during ...
When I try to upload CSV without "id" field throws this error. Line number: 1 - u'id' 13173474, Harry McDade, 10.harry.asas@ ...
Read more >[Answered]-django-import-export: cannot exclude id field ...
On Django-1.9.6, django-import-export-0.5. When I try to upload CSV without "id" field throws this error. Line number: 1 - u'id' 13173474, Harry McDade, ......
Read more >cannot exclude id field during import : KeyError: u'id' -
am trying to import in admin and already excluded the id field but i get. Traceback (most recent call last): File ...
Read more >labelbox.schema.data_row_metadata — Python SDK reference 3.33 ...
Source code for labelbox.schema.data_row_metadata. # type: ignore from datetime import datetime from copy import deepcopy from enum import Enum from ...
Read more >How do I fix KeyError Using Vals? - Odoo
Thanks for your subscription! keyerror. I have this code: import time from openerp.osv import fields, osv import ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
yes that’s what i did to fix the problem but i think its not necessary to include id field when importing new data, a fix for this in the package would be nice.
i’m having the same issue, it seems like the meta class option import_id_fields doesn’t work when you give it a new value. it still using the default one ‘id’.
eventually, i have to change the xls file to add a column ‘id’ in header then import works