1👍
✅
Basically, you need to define custom InstanceLoader
class in your resource inner Meta
class:
class BookResource(resources.ModelResource):
class Meta:
model = Book
fields = ('id', 'name', 'price',)
instance_loader_class = MyCustomInstanceLoaderClass
class MyCustomInstanceLoaderClass(BaseInstanceLoader):
def get_instance(self, row):
# your implementation here
Something like this should help you.
Source:stackexchange.com