title: ORM to the distinct values from a model based on the latest datetime field in Django
body: <p>Consider I have a model named History and it has data like this.</p>
  
  <pre><code>name       comment           date
  ----------------------------------
  Jake    some comment     2017-06-20
  John    some comment     2017-08-20
  Jake    some comment     2017-06-21
  Albert  some comment     2017-06-21
  </code></pre>
  
  <p>and from the above sample data, I want to get distinct data based on the datetime field. For example, the result should look like below from the above sample data.</p>
  
  <pre><code>name       comment           date
  ----------------------------------
  John    some comment     2017-08-20
  Jake    some comment     2017-06-21
  Albert  some comment     2017-06-21
  </code></pre>
  
  <p>How can I write an ORM for this? can anyone please help me!</p>