title: In Django, how to sort instances of a child model class based on a field of its parent model class?
body: <p>Here is the code:</p>
  
  <pre><code>class Brand(models.Model):
      brand_name = models.CharField(max_length=200)
      def __unicode__(self):
          return self.brand_name
  
  class Product(models.Model):
      product = models.ForeignKey(Brand)
      product_name = models.CharField(max_length=300)
      class Meta:
          ordering = ['product_name']
      def __unicode__(self):
          return self.product_name
  </code></pre>
  
  <p>Let's say I have 2 brands, each with 2 products: Canon (camera, printer) and Samsung (laptop, tablet). When I create instances of Product, I will be able to sort them by their name on an Admin page: camera, laptop, printer, tablet. So far so good.
  But what I actually would like to do is to sort them by [Brand + Product], so the sorted list should look like this: 'Canon - camera', 'Canon - printer', 'Samsung - laptop', 'Samsung - tablet'.</p>
  
  <p>In order to do so I have to somehow access the value of the brand_name field from within the Product class. Is that possible and if so, how? Or is there an other/better way to achieve this type of sorting?</p>