Skip to content

Implement median processing time

Erwan Rouchet requested to merge workeractivity-median into master

Requires !1860 (merged), closes #1394 (closed)

This implements a subclass of django.db.models.Aggregate which supports PostgreSQL's ordered set aggregates, one of them being percentile_cont. This is done in a more complex way than what was implemented in Callico because computed expressions, not just field names, were required. The implementation uses the undocumented OrderByList expression, added in Django 4.1, which can take in a list of parameters as what can be sent to QuerySet.order_by and turns them into an ORDER BY clause that can be used in this aggregate.

Edited by Erwan Rouchet

Merge request reports

Loading