Hopefully easy question. I have a query set of actions and each action has a time_estimate. I want to get the average time_estimate across all of the actions in the queryset such that this returns the average:
{{ actions.avg_time_estimate }}
I tried
actions.avg_time_estimate = actions.aggregate(Avg('time_estimate'))
but this is assigning a dictionary to actions.avg_time_estimate, meaning I get my average like this:
{{ actions.avg_time_estimate.effort__avg }}
What is the correct way to pull the average into the queryset? I also want to retain the actual list of actions in the query.