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

Fixed #31051 -- Allowed dumpdata to handle circular references in natural keys. #12458

Merged
merged 2 commits into from Apr 7, 2020

Conversation

matthijskooijman
Copy link
Contributor

@matthijskooijman matthijskooijman commented Feb 14, 2020

This is a slightly cleaned up version of #12166, fixing just ticket-31051.

@matthijskooijman matthijskooijman changed the title Fix 31051 Fixed #31051 -- Fix handling of circular references involving natural keys Feb 14, 2020
Copy link
Member

@felixxm felixxm left a comment

Choose a reason for hiding this comment

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

@matthijskooijman Thanks 👍 Sorry for a delay but I'm still trying to split these changes into related/unrelated bits.

tests/backends/base/test_creation.py Outdated Show resolved Hide resolved
tests/backends/base/test_creation.py Outdated Show resolved Hide resolved
@felixxm
Copy link
Member

felixxm commented Apr 2, 2020

Rebased.

@felixxm
Copy link
Member

felixxm commented Apr 7, 2020

I tried to move all tests that work without this patch to a separate PR #12680.

@felixxm
Copy link
Member

felixxm commented Apr 7, 2020

Rebased on top of #12680.

@felixxm felixxm changed the title Fixed #31051 -- Fix handling of circular references involving natural keys Fixed #31051 -- Allowed dumpdata to handle circular references in natural keys. Apr 7, 2020
…ural keys.

Since #26291 forward references in natural keys are properly handled by
loaddata, so sorting depenencies in dumpdata doesn't need to break on
cycles. This patch allows circular references in natural keys by
breaking sort_depenencies() on loops.
…ign keys are not used.

There is no need to sort dependencies when natural foreign keys are not
used.
@felixxm
Copy link
Member

felixxm commented Apr 7, 2020

@matthijskooijman Thanks again 👍 I pushed minor edits and reorganized commits.

@felixxm felixxm merged commit 2e67e80 into django:master Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants