title: many to many ordered records django
body: <p>I am getting all related records using user.companies.all().</p>
  
  <p>But this query is giving me random records from the userProfile_companies table. I need the order in which the records are added in the bridging table.
  models.py</p>
  
  <pre><code>class UserProfile(models.Model):
      companies = models.ManyToManyField('Company', blank=True, null=True)
  </code></pre>
  
  <p>company_manager.py</p>
  
  <pre><code>for company in user.companies.all():
      companiesToBeIncluded.append(company.id)
  </code></pre>
  
  <p>Here I'm getting incorrect order of company ids.
  Thanks</p>