Django queryset filter performance
<p>I have a queryset :-</p>

<pre><code>queryset = my_object.someobject_set.all()
</code></pre>

<p>From there onwards, I want to filter from the queryset. i.e:</p>

<pre><code>print queryset.filter(name='some1').exists()
print queryset.filter(name='some2').exists()
print queryset.filter(name='some3').exists()
</code></pre>

<p>But for each of the filter queries, there is a database hit again. How can I cache the queryset and then filter from it?</p>

<p>I even tried to evaluate the queryset before filtering by doing this:-</p>

<pre><code>print len(queryset)
</code></pre>

<p>But this doesn't work.
Any help??</p>