#35854: Order of "choices" on CharField randomly changing forcing new migrations
despite no changes.
-----------------------------------+--------------------------------------
Reporter: WoosterInitiative | Owner: (none)
Type: Bug | Status: closed
Component: Migrations | Version: 5.1
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Comment (by WoosterInitiative):
Replying to [comment:2 Claude Paroz]:
> I don't think that a `set()` is a supported data structure for model
field choices. Maybe we should replace `A mapping or iterable in the
format described below` by `A mapping or sequence in the format described
below` in
[https://docs.djangoproject.com/en/5.1/ref/models/fields/#choices the
docs]?
Figured this out. It isn't explicitly *not* allowed, but it causes the
issue I reported. If it is going to be allowed in the docs explicitly,
migrations should handle it well.
Beyond that, I don't know why one would need a `set()`. Pretty sure I was
just combining a couple of sections of the docs when I wrote it because I
can't ever remember the specific syntax and made a mistake.
Curious if a check could be created to prevent my (and other's) future
confusion?
--
Ticket URL: <https://code.djangoproject.com/ticket/35854#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 on the web visit
https://groups.google.com/d/msgid/django-updates/01070192b0b331df-3a877f99-8deb-4d97-b640-d1dd94230843-000000%40eu-central-1.amazonses.com.