title: How to know some object's order in django queryset
body: <pre><code>qs1 = QueryModel.objects.all().order_by('?')
  
  obj1 = QueryModel.objects.get(pk=123)
  
  def order_stuff(queryset, obj)
      return print(#obj_order_from_queryset)
  order_stuff(qs1, obj1) &gt;&gt;&gt; some ordering number
  </code></pre>
  
  <p>How to know some object's order on some queryset?</p>
  
  <p>For example, if queryset are like:</p>
  
  <pre><code>print(qs1) &gt;&gt;&gt; {'pk': 1}, {'pk': 3}, {'pk': 4}, {'pk': 123} ...
  </code></pre>
  
  <p>So that:</p>
  
  <pre><code>order_stuff(qs1, obj1) &gt;&gt;&gt; 4
  </code></pre>
  
  <p>if queryset are like:</p>
  
  <pre><code>print(qs1) &gt;&gt;&gt; {'pk': 123}, {'pk': 3}, {'pk': 4}, {'pk': 13} ...
  </code></pre>
  
  <p>So that:</p>
  
  <pre><code>order_stuff(qs1, obj1) &gt;&gt;&gt; 1
  </code></pre>
  
  <p>if queryset are like:</p>
  
  <pre><code>print(qs1) &gt;&gt;&gt; {'pk': 13}, {'pk': 123}, {'pk': 4}, {'pk': 13} ...
  </code></pre>
  
  <p>So that:</p>
  
  <pre><code>order_stuff(qs1, obj1) &gt;&gt;&gt; 2
  </code></pre>
  
  <p>How to do this?</p>