title: Filtering on Foreign Keys in Django
body: <p>I have a few models in Django where I attach a location to each blog published:</p>
  
  <pre><code>class Country(models.Model):
      country_name = models.TextField()
  
  class Town(models.Model):
      country = models.ForeignKey(Country)
      town_name = models.CharField(max_length=192)
  
  class Blog(models.Model):
      town = models.ForeignKey(Town)
  </code></pre>
  
  <p>I'm trying to filter them on country name but I'm getting "SyntaxError: keyword can't be an expression" when I try the following:</p>
  
  <pre><code>blog_list = Blog.objects.filter( town.country.country_name = 'Canada' ).order_by( '-id' )
  </code></pre>
  
  <p>Any ideas on how I could filter based on the country name?</p>