Ignore import_id_fields in class Meta
See original GitHub issueErrors Line number: 1 - "Column ‘id’ not found in dataset. Available columns are: [‘name’, ‘model’,‘content’]
class PageResource(resources.ModelResource):
class Meta:
model = Page
import_id_fields = ('name',)
system: python 3.4.3, django 1.9
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:6
Top Results From Across the Web
what does exclude in the meta class of django mean?
The exclude attribute tells Django what fields from the model not to include in the form. Quoting the Selecting fields to use section...
Read more >ModelForm.Meta.exclude only excludes model fields, not form ...
If I have a ModelForm that inherits from another form, and I define exclude and/or fields, these only affect fields on the model....
Read more >Getting started — django-import-export 3.0.1 documentation
A manager class with the get_by_natural_key function is required for importing foreign key relationships by the field model's natural key, and the model...
Read more >Django ModelForm - Create form from Models - GeeksforGeeks
class PartialAuthorForm(ModelForm): class Meta: model = Author exclude = ['title']. Finally, to complete our MVT structure, create a view ...
Read more >Problems with "Class Meta" and " __str__" - Google Groups
Hello, I do these models but the Django admin page doesn't read the "class Meta" and " __str__". This is the models.py document....
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 Free
Top 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
hi @gbozee @haidaraM ,thanks to comments but it doesn’t solve the problem. 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’.import_id_fields
does NOT work for me eitherAnd adding
exclude = ('id',)
did NOT work either.Python Python 2.7.10 Django 1.11.20 django-import-export 1.2.0