#23112: Field.get_choices tries to index an iterable
----------------------------------------------+--------------------
Reporter: bernie_sumption | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: master
Severity: Release blocker | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+--------------------
Issue #23098 was fixed with this commit:
https://github.com/django/django/commit/2f73b527dda6683868fac2791f7f07ccb01ea0d9
Which adds the following line:
{{{
named_groups = self.choices and isinstance(self.choices[0][1], (list,
tuple))
}}}
According to the docs -
https://docs.djangoproject.com/en/dev/ref/models/fields/#choices -
Field.choices can be any iterable of choices. The above line introduces
the requirement that the choices object to be subscriptable, and breaks
both my own code and a 3rd party library I'm using (django_countries).
--
Ticket URL: <https://code.djangoproject.com/ticket/23112>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/058.00b3459ffeccb08b28b3dd802d24d368%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.