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

fix declaring existing model fields in ModelResrouce altering export … #1692

Conversation

cocorocho
Copy link
Contributor

#1663

Problem

Declaring existing model field(s) in ModelResource changes export order

Solution

On ModelDeclarativeMetaclass definition, if resource field exists in model fields, keep the order instead of pushing all declared fields before model fields.

Acceptance Criteria

Have you written tests? Have you included screenshots of your changes if applicable?
Yes

Did you document your changes?
Yes

Copy link
Contributor

@matthewhegarty matthewhegarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks for submitting.
Just had a minor comment about the tests.

You might need to install pre-commit as well (see contributing.rst)

@matthewhegarty matthewhegarty linked an issue Nov 23, 2023 that may be closed by this pull request
Copy link
Contributor

@matthewhegarty matthewhegarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just one comment about decorators in the test

@matthewhegarty matthewhegarty merged commit 9f63bfc into django-import-export:release-4 Nov 24, 2023
11 checks passed
@cocorocho cocorocho deleted the fix-declared-model-fields-altering-export-order branch November 25, 2023 21:19
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.

Declaring a Resource Field changes the export order
2 participants