class FooRole(models.IntegerChoices):
FOO = 0, "Foo"
BAR = 1, "Bar"
BAZ = 2, "Baz"
QUX = 3, "Qux"
class FooModel(models.Model)
role = IntegerChoicesField(
choices_enum=WorkspaceUserRole, default=FooRole.FOO
)
...which when used with MultiSelectFieldListFilter looks like:
i think the labels from the fields in django-choices-field could be used if this lookup on self.field.choices could fall back to self.field.choices_enum.choices:
self.field_verboses = {
field_value: field_verbose
for field_value, field_verbose in self.field.choices
}
using bellini666/django-choices-field, i have an integer field defined like:
...which when used with
MultiSelectFieldListFilter
looks like:i think the labels from the fields in django-choices-field could be used if this lookup on
self.field.choices
could fall back toself.field.choices_enum.choices
: