title: What is the default order of a list returned from a Django filter call?
body: <p><strong>Short Question</strong><br>
  What is the default order of a list returned from a Django filter call when connected to a PostgreSQL database?  </p>
  
  <p><strong>Background</strong><br>
  By my own admission, I <em>had</em> made a poor assumption at the application layer in that the order in which a list is returned will be constant, that is without using 'order_by'.  The list of items I was querying is not in alphabetic order or any other <strong>deliberate</strong> order.  It was thought to remain in the same order as which they were added to the database.  </p>
  
  <p>This assumption held true for hundreds of queries, but a failure was reported by my application when the order changed unknowingly.  To my knowledge, none of these records were touched during this time as I am the only person who maintains the DB.  To add to the confusion, when running the Django app on Mac OS X, it still worked as expected, but on Win XP, it changed the order.  (Note that the mentioned hundreds of queries was on Win XP).  </p>
  
  <p>Any insight to this would be helpful as I could not find anything in the Django or PostgreSQL documentation that explained the differences in operating systems. </p>
  
  <p><strong>Example Call</strong>  </p>
  
  <pre><code>required_tests = Card_Test.objects.using(get_database()).filter(name__icontains=key)
  </code></pre>
  
  <p><strong>EDIT</strong><br>
  After speaking with some colleague's of mine today, I had come up with the same answer as Björn Lindqvist.  </p>
  
  <p>Looking back, I definitely understand why this is done wrong so often.  One of the benefits to using an ORM Django, sqlalchemy, or whatever is that you can write commands without having to know or understand (in detail) the database it's connected to.  Admittedly I happen to have been one of these users.  However on the flip-side of this is that without knowing the database in detail debugging errors like this are quite troublesome and potentially catastrophic.  </p>