Skip to content
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

Refactor import_row call by using keyword arguments. #585

Merged
merged 1 commit into from Mar 17, 2017
Merged

Refactor import_row call by using keyword arguments. #585

merged 1 commit into from Mar 17, 2017

Conversation

korkmaz
Copy link
Contributor

@korkmaz korkmaz commented Mar 16, 2017

Resource.import_row defines using_transaction, dry_run as keyword arguments. But when calling it they are send as positional arguments.

So if We don't need any of those keyword arguments We shouldn't have to define them in my overriden import_row function.

The below usage is not possible with the current implementation.

class MyResourse(ModelResource):

    def import_row(self, row, instance_loader, dry_run=False, **kwargs):
        ...

We have to write

def import_row(self, row, instance_loader, using_transactions=False, dry_run=False, **kwargs):

or

def import_row(self, row, instance_loader, using_transactions, dry_run, **kwargs):

@bmihelac bmihelac merged commit 6862de9 into django-import-export:master Mar 17, 2017
@bmihelac
Copy link
Member

Good catch, thanks!

@korkmaz korkmaz deleted the fix/import-row-call-keyword-args branch March 17, 2017 05:44
@mgrdcm mgrdcm mentioned this pull request Nov 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants