ambv/dj.choices

Idea: Make ChoiceGroups iterable

ktosiek opened this issue · 0 comments

I'd like to be able to write:

Organization.objects.filter(status__in=OrganizationStatusChoices.ACTIVE_GROUP)

where ACTIVE_GROUP is a ChoiceGroup of all statuses that are somehow "active". A way to do this would be to make iterating over ChoiceGroup return ids of the choices, or making ChoiceField aware of ChoiceGroups. Is something like that planned?