ngageoint / scale

Processing framework for containerized algorithms
http://ngageoint.github.io/scale/
Apache License 2.0
105 stars 45 forks source link

Add computed column for duration in jobs endpoint #1867

Closed mheppner closed 4 years ago

mheppner commented 4 years ago

Pain Point? Please describe. See ngageoint/scale-ui#294.

The UI is calculating a job's duration from the started and ended fields. In data tables, this column is not able to be sorted on, since this happens at the SQL level for paged results.

Desired Solution Annotate the queryset with an F() expression and expose this field through DRF. See: https://stackoverflow.com/a/32856190