title: Sorting ManyToMany field automatically in Django model
body: <p>I currently have a set of models that look similar to this contrived code:</p>
  <pre><code>class Pizza(models.Model):
      price = models.FloatField()
      topping = models.ManyToManyField(Topping, through=&quot;PizzaToppings&quot;)
  
  class Topping(models.Model):
      name = models.CharField(max_length=50)
  
  class PizzaToppings(models.Model):
      class Meta:
          ordering=[&quot;order_to_add_topping&quot;]
  
      pizza = models.ForeignKey(Pizza)
      topping = models.ForeignKey(Topping)
      order_to_add_topping = models.IntegerField()
  </code></pre>
  <p>My problem is that what happens when I attempt to access the toppings of a pizza in the order specified in the PizzaToppings ManyToMany extra fields table.  Assume the pizza has cheese and ham, with the order_to_add_topping in the PizzaToppings data set to 0 and 1 respectively:</p>
  <pre><code>&gt;&gt;&gt; pizza = Pizza.objects.get(pk=490)
  &gt;&gt;&gt; pizza.toppings.all()[0].name
  'Ham'
  </code></pre>
  <p>That should say 'Cheese'.  I would have thought the RelationManager would have respected the <code>ordering</code> Meta class field, but it appears it doesn't.  So I guess accessing the name of the first topping added to the pizza shouldn't be done with <code>pizza.toppings.all()[0].name</code>.</p>
  <p>How should it be accessed?  Is the problem with my model query or is it how I have my models set up?</p>