Inspired by this gist
The class extends to calculate any percentile (not just median).
Percentile('some_field', percentile=0.5) # calculates median for the field
Percentile('some_field', percentile=0.9) # calculates the 90th percentile
For completeness, I can calculate the median age of some Student model like so: