title: Groupby aggregated time in equal intervals
body: <p>I have a model with a DateTimeField and I want to run some queries so I can get sum of other fields, grouped by specific time intervals like: 5min, 10min, 1hr, 3hr and etc.
  I also need the intervals beginning and end.
  I need this queries for drawing some charts, with the x-axis being time and the y-axis being sum of other field like sum of count.</p>
  
  <pre><code>   count = models.IntegerField(null=False)
     time = models.DateTimeField(null=False)
  </code></pre>