title: Does Django query the database on every iteration?
body: <p>In Django, if I write:</p>
  
  <pre><code>for i in User.objects.all():
      i.active()
  </code></pre>
  
  <p>I know I can set a variable to the current state of User.objects.all() and then run the loop but I'd like to know what python is really doing. Will Python get the list of users only once and then iterate over that list? Or will it query the database on every iteration?</p>