We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The url that django generates for filers (field__exact=x) ends up using str(some_enum) instead of some_enum.value for x.
field__exact=x
str(some_enum)
some_enum.value
x
This is can be tested by adding a field_x (which is an enum field) to the filters = ('field_x',) of a registered model admin.
field_x
filters = ('field_x',)
The text was updated successfully, but these errors were encountered:
The README says to use:
from enumfields.admin import EnumFieldListFilter class MyModelAdmin(admin.ModelAdmin): list_filter = [('color', EnumFieldListFilter)]
which seems to work well combined with:
list_display = [ ... '_color', ... ] @staticmethod def _color(obj): return obj.state
to force column values to be formatted the same as the filter.
Sorry, something went wrong.
Thanks! This is what I was looking for. I don't know how I missed it.
If there is normal any way to make this automatic I'd be glad to help.
No branches or pull requests
The url that django generates for filers (
field__exact=x
) ends up usingstr(some_enum)
instead ofsome_enum.value
forx
.This is can be tested by adding a
field_x
(which is an enum field) to thefilters = ('field_x',)
of a registered model admin.The text was updated successfully, but these errors were encountered: