title: Order Django Query Results by Foreign Key
body: <p>I have a model that is set up as follows:</p>
  
  <pre><code>class Log(models.Model):
      name = models.ForeignKey(User)
      date = models.DateField()
      time = models.TimeField()
  </code></pre>
  
  <p>I know this does not work, but is there any other way I can run a query something like this:</p>
  
  <pre><code>Logs.objects.filter(date=someDate).order_by('name__last_name')
  </code></pre>
  
  <p>I just need the final result to be a <code>QuerySet</code> ordered by the last name of the User that is related by the <code>ForeignKey</code>.</p>
  
  <p>I'm really at my wits end about this one.
  Anything would help: some method that I haven't look at, an actual raw SQL query or even just a general idea to pursue would be greatly appreciated!</p>