You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from import_export import resources, fields
from .models import Profile
class ProfileResource(resources.ModelResource):
class Meta:
model = Profile
fields = ('rollno', 'name', 'resident_hostel', 'subscribed_hostel')
rollno = fields.Field(readonly = True)
I get an error 'tuple' object has no attribute 'Field' in the last line.
I assume this is because import_export.fields is being shadowed by the fields tuple that specify white listed fields.
The easy fix is : from import_export.fields import Field instead of from import_export import fields
But I think this problem should be mentioned in the Getting Started section of docs, so that new users don't get confused.
The text was updated successfully, but these errors were encountered:
thanks for raising this, I see how it can add confusion. Would you like to make PR which would update docs to use from import_export.fields import Field instead of from import_export import fields?
krishraghuram
added a commit
to krishraghuram/django-import-export
that referenced
this issue
Dec 11, 2017
I get an error
'tuple' object has no attribute 'Field'
in the last line.I assume this is because import_export.fields is being shadowed by the fields tuple that specify white listed fields.
The easy fix is :
from import_export.fields import Field
instead offrom import_export import fields
But I think this problem should be mentioned in the Getting Started section of docs, so that new users don't get confused.
The text was updated successfully, but these errors were encountered: