title: Sorting Related objects in Django
body: <p>I have 2 models Category and Item. An Item has a reference to a Category.</p>
  
  <pre><code>class Category(models.Model):
      name = models.CharField(max_length=32)
  
  class Item(model.Models):
      name = models.CharField(max_length=32)
      category = models.ForeignKey(Category)
      sequence = models.IntegerField()
  </code></pre>
  
  <p>The sequence field is supposed to capture the sequence of the Item within a category. </p>
  
  <p>My question is:
  What Meta Options do i need to set on category and/or item such that when i do:</p>
  
  <pre><code>category.item_set.all()
  </code></pre>
  
  <p>that I get the Items sorted by their sequence number.</p>
  
  <p>PS: I am now aware of a meta option called ordering_with_respect_to .. but it is still unclear how it works, and also i have legacy data in the sequence columns. I am open to data migration, if the right approach requires that.</p>