Re: Averaging timestamp deltas with Django ORM

2022-09-15 Thread Joshua Corlin
Thank you, this is exactly what I was looking for -Josh On Wednesday, September 7, 2022 at 5:47:18 PM UTC-6 Thomas wrote: > Something like qs.aggregate(delay=Avg(F(“approved_at”) - > F(“created_at”)))[“delay”] > > where I cribbed the technique from >

Re: Averaging timestamp deltas with Django ORM

2022-09-08 Thread Toshar Saini
Something like qs.aggregate(delay=Avg(F(“approved_at”) - F(“created_at”)))[“delay”] try this On Thu, Sep 8, 2022 at 5:16 AM Thomas Lockhart wrote: > Something like qs.aggregate(delay=Avg(F(“approved_at”) - > F(“created_at”)))[“delay”] > > where I cribbed the technique from >

Re: Averaging timestamp deltas with Django ORM

2022-09-07 Thread Thomas Lockhart
Something like qs.aggregate(delay=Avg(F(“approved_at”) - F(“created_at”)))[“delay”] where I cribbed the technique from https://stackoverflow.com/questions/50219652/django-queryset-get-avg-of-2-fields hth -

Averaging timestamp deltas with Django ORM

2022-09-07 Thread Joshua Corlin
Hello Everyone, This is my first posting on this forum, please let me know if I have done anything incorrectly. I have a seemingly simple task I am trying to achieve with one of my projects. Looking to see if the following is possible, and if so what the syntax would be with the Django