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

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -