title: Aggregation in Django viewset - Django Rest Framework:
body: <p>I have a table with the following attributes:</p>
  <pre class="lang-py prettyprint-override"><code>created_at = TimestampField(auto_now_add=True,auto_now_update=False, editable=False)  
  updated_at = TimestampField(null=True,auto_now_update=True, editable=False)
  </code></pre>
  <p>And one service is running there, first comes into the system and we capture <strong><code>created_at</code></strong> timestamp.</p>
  <p>And after some time on service completion, the script updates the table attributes and we capture <strong><code>updated_at</code></strong> timestamp.</p>
  <p>So now I want to find the AVERAGE of the service deployment time i.e. addition of <strong>(<code>updated_at-created_at</code>)</strong> divide by total services or we can say total rows in the table.</p>
  <p>So that query needs to be implemented in <strong>Django ORM</strong> and have to serialize to the endpoint.</p>
  <p>So that data can be fetched in Front-End.</p>
  <p>Could you guys help me out here that would be highly appreciable?</p>