-
-
Notifications
You must be signed in to change notification settings - Fork 782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Additional customization hooks #61
Comments
It looks like nice addition so please go ahead and make PR. Do not forget tests and docs :) Maybe transferring |
I think that transferring dry_run is the best way for now, because if we are using transaction management we need to pass it as False to the lower-level code even if it is |
agreed |
bmihelac
added a commit
that referenced
this issue
Jan 21, 2014
Add additional customization hooks - fixes #61
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are some hooks in
Resource
to allow easy customization:before_save_instance
, etc.I want to take an extract file and use it to create some parent models as part of the same import process. The best way for me to do this, is to call the
import_data
method for the other ModelResources immediately before I start processing the rows (so that I am already inside the transaction management, if required). At the moment, I have to copy and paste the entireimport_data
method into myResource
: it would be better if we had something like:Similarly, some of my customizations work by overriding
import_obj
, but this can more difficult than necessary because we don't know whether we are in a dry run or not.This could be solved by adding
dry_run
to the method signature ofimport_obj
and passing it when you call it fromimport_data
.Would those changes be acceptable? If they would, I'll prepare a pull request.
The text was updated successfully, but these errors were encountered: