Consider the following:
status = queryset.values('status').annotate(count=Count('status'))
where status
field is a CharField
with choices
. This will result in a list of dictionaries with status
DB value along with its count.
Is there a way to aggregate status
and show its display value instead? I have looked up the code of _get_FIELD_display
which I probably can emulate, but it feels a tad hackish to repeat the framework's internal code.
status
->status
aggregated with its display value – Sphinx