python - Override get_instance import-export django -
i have basic problem in django/ python. don't know right answer.
i have override "get_instance" in django-import-export.instance_loaders
actually change code directly in function. know not clever. don#t understand should override function.
in mymodelresource or where?
hope can me. thanks
basically, need define custom instanceloader
class in 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): # implementation here
something should you.
Comments
Post a Comment