title: Most efficient way to filter for lowest values in queryset
body: <p>Given:</p>
  
  <pre><code>some_list = SomeClass.objects.filter(something=something).order_by('-X','-Y')
  </code></pre>
  
  <p>In English: <code>some_list</code> is a filtered list of <code>SomeClass</code> objects, ordered by two values, first <code>X</code>, then <code>Y</code>.  </p>
  
  <p>If I then want to limit the number of entries in the list to some value <code>Z</code>, I can do this:</p>
  
  <pre><code>final_list = some_list[:Z]
  </code></pre>
  
  <p>But what if I want to limit the number of entries to some value, but randomize the "cut-off entries" before I do?  I'm having a hard time describing, so an example:</p>
  
  <pre><code>SC  X  Y
   A  2  3
   B  1  2
   C  1  1
   D  1  1
   E  1  1
   F  1  0
   G  0  3
  </code></pre>
  
  <p>If <code>Z=3</code> then, using my method, <code>final_list = (A,B,C)</code>.  What I want is <code>final_list</code> to include A and B because they are clearly above the others(A has greater X than any others, and B is tied for second most X but has greater Y), but seeing as the cut-off would be at C which is <code>X=1,Y=1</code>, and there are two OTHER objects "tied" with C, the third slot could be C, D, or E.</p>
  
  <p>I could pull <code>some_list</code> apart by hand and examine values and start putting them into <code>final_list</code> until I hit Z, but I was hoping there was a better way I don't know of.  As in, less lines of code, less processing power, etc.</p>
  
  <p>So for this example, I would expect one of these outputs, at random:</p>
  
  <pre><code>final_list = (A, B, C)
  final_list = (A, B, D)
  final_list = (A, B, E)
  </code></pre>
  
  <p>If Z = 4, I would expect one of these outputs:</p>
  
  <pre><code>final_list = (A, B, C, D)
  final_list = (A, B, C, E)
  final_list = (A, B, D, C)
  final_list = (A, B, D, E)
  final_list = (A, B, E, C)
  final_list = (A, B, E, D)
  </code></pre>
  
  <p>Hopefully that is clear.</p>