1
0
mirror of https://github.com/django/django.git synced 2025-01-03 23:16:41 +00:00
Commit Graph

3 Commits

Author SHA1 Message Date
Nick Pope
bbe90f3c00 [5.0.x] Refs #34899 -- Extracted Field.flatchoices to flatten_choices helper function.
Co-authored-by: Natalia Bidart <124304+nessita@users.noreply.github.com>

Backport of 74afcee234 from main
2023-10-23 14:53:13 -03:00
Nick Pope
711c054722 [5.0.x] Refs #31262 -- Added __eq__() and __getitem__() to BaseChoiceIterator.
This makes it easier to work with lazy iterators used for callables,
etc. when extracting items or comparing to lists, e.g. during testing.

Also added `BaseChoiceIterator.__iter__()` to make it clear that
subclasses must implement this and added `__all__` to the module.

Co-authored-by: Adam Johnson <me@adamj.eu>
Co-authored-by: Natalia Bidart <124304+nessita@users.noreply.github.com>

Backport of 07fa79ef2b from main
2023-10-23 14:51:27 -03:00
Nick Pope
500e01073a
Fixed #31262 -- Added support for mappings on model fields and ChoiceField's choices. 2023-08-30 22:57:40 -03:00