title: Ordering many-to-many relations in Django models
body: <p>Suppose you have a many-to-many relation in a Django model, such as:</p>
  
  <pre><code>class GroceryList(models.Model):
      items = models.ManyToManyField(GroceryItem, related_name='in_lists')
  
  class GroceryItem(models.Model):
      name = models.CharField(unique=True)
  </code></pre>
  
  <p>You and me can both have the same items in two different lists, such as <code>Avocado</code>, and they will point to the same <code>Avocado</code> object.</p>
  
  <p>What is the best way to implement an arbitrary <strong>order</strong> for items in each list, that can be edited separately for each list? (i.e. I have <code>Avocado</code> first in my list, while you have it at index <code>4</code>)</p>
  
  <p><a href="https://github.com/bfirsh/django-ordered-model/">django-ordered-model</a> seems like an interesting solution, but it assumes global order across all objects.</p>