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

Make deep copy of fileds from class attr to instance attr #550

Merged
merged 2 commits into from May 17, 2018
Merged

Make deep copy of fileds from class attr to instance attr #550

merged 2 commits into from May 17, 2018

Conversation

andrei9lv
Copy link
Contributor

The fields resource class attribute is the class-wide definition of
fields. Because a particular instance of the class might want to
alter self.fields, we create self.fields here by copying cls.fields.
Instances should always modify self.fields; they should not modify
cls.fields.

The fields resource class attribute is the *class-wide* definition of
fields. Because a particular *instance* of the class might want to
alter self.fields, we create self.fields here by copying cls.fields.
Instances should always modify self.fields; they should not modify
cls.fields.
@shaggyfrog
Copy link
Contributor

Thanks for the contribution! Could you add a test for this behaviour?

@andrei9lv
Copy link
Contributor Author

Ok, I'll do it a little bit later

Test checks that resource instance *fields* attr doesn't refer to attr *fields* of resource class
@andrei9lv
Copy link
Contributor Author

I've added some tests which cover this functional

@bmihelac bmihelac merged commit 7045e39 into django-import-export:master May 17, 2018
@bmihelac
Copy link
Member

Thanks @Andrew-bro for PR, @shaggyfrog for review!

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

3 participants