#36750: dumpdata's output of m2m values is not deterministic
--------------------------------------+------------------------------------
Reporter: Jacob Walls | Owner: (none)
Type: Bug | Status: new
Component: Core (Serialization) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Comment (by VIZZARD-X):
Thanks, Simon — that makes sense.
I realized my earlier attempt used tests.test_sqlite, which explains why
the issue didn’t reproduce.
Running the same test suite against Postgres: python tests/runtests.py
fixtures --shuffle 7825542710 --settings=tests.test_postgres -k forward
-v2
I can now reproduce the nondeterministic ordering exactly as reported by
@Jacob.
I’ll work on a patch that:
- orders the M2M related manager by the target model’s primary key (as you
suggested),
- updates both Python + XML serializers, and
- adds a test for deterministic natural key ordering.
I’ll submit a PR shortly.
--
Ticket URL: <https://code.djangoproject.com/ticket/36750#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019aaca79615-cd473c58-f9b1-45b5-9345-f89ed092448a-000000%40eu-central-1.amazonses.com.