#35854: Order of "choices" on CharField randomly changing forcing new migrations
despite no changes.
----------------------------+--------------------------------------
Reporter: Karl | 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 Natalia Bidart):
Replying to [comment:5 Claude Paroz]:
> Replying to [comment:3 Natalia Bidart]:
> > Do you see a concrete issue with using sets? (other than dropdowns or
options being shown in a random order).
>
> The main issue is that in 99% of the case, it will be an oversight by
the dev, and cause the issue at hand. Do you see a valid use case using
sets?
Thank you for the response! My use case is, perhaps, a little simplistic
or even a stretch, but let me share it:
You want your site users to pay attention when choosing an option so you
use a set to have a non deterministic order of the displayed options.
> I do agree with the reporter that if we support sets(), we should also
fix the migration issue.
I disagree with this one. If a Django user uses a set(), I think they may
be up to two goals:
1. Either they made a mistake, and the infinite migrations make them
notice (and fix that), or
2. They intentionally did this and solve the migration issue by using a
callable.
In any case, unordered choices and the migration issues is really what's
#26609 is about (back when dicts weren't sorted), which was wontfixed.
Perhaps disallowing unordered iterables should be discussed and
potentially re-opened there? Thanks!
--
Ticket URL: <https://code.djangoproject.com/ticket/35854#comment:6>
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/01070192b454445c-9227c7c4-0284-4c68-b471-886ceb218adc-000000%40eu-central-1.amazonses.com.