title: Django Query Best Practice
body: <p>Wondering about some Django querying performance/best practices. It is my understanding that QuerySets are <a href="https://docs.djangoproject.com/en/2.0/topics/db/queries/#filtered-querysets-are-unique" rel="nofollow noreferrer">"lazy"</a> as the documentation states and that the three queries below do not run until they are actually evaluated at some point. Is that a correct understanding and is the below snippet a reasonable way to query against the same table for three different filter values against the same field?</p>
  
  <pre><code>    # General Education
      general_education_assignments = FTEAssignment.objects.filter(
          group_name='General Education'
      )
      # Specials
      specials_assignments = FTEAssignment.objects.filter(
          group_name='Specials'
      )
      # Dual
      dual_assignments = FTEAssignment.objects.filter(
          group_name='Dual Language'
      )
  </code></pre>
  
  <p>Even more so what I am wondering about besides if my understanding of the above is correct is if the below is in anyway more efficient (I don't think it will be)? Also, if either the above or below is better stylistically for Django or more 'pythonic'?</p>
  
  <pre><code>    # Get all assignments then filter
      fte_assignments = FTEAssignment.objects.all()
      # General Education
      general_education_assignments = fte_assignments.filter(
          group_name='General Education')
      # Specials
      specials_assignments = fte_assignments.filter(group_name='Specials')
      # Dual
      dual_assignments = fte_assignments.filter(group_name='Dual Language')
  </code></pre>
  
  <p>Thank you!</p>