No, there is no way to do what you want. All filters are implemented as 
filters in the DB, Django doesn't know how to execute them in Python. There 
was some effort to implement filters also in Python, but there hasn't been 
any activity on this recently.

The only way to do this currently is to implement the filtering logic in 
Python yourself.

 - Anssi

On Wednesday, April 9, 2014 8:33:16 AM UTC+3, Jill Green wrote:
>
> I apologize if this question has already been asked and answered.  I want 
> to know if it's possible to filter out query sets without doing lazy 
> queries or hitting the database again.  Basically I have this query: 
>
> qs= self.filter(a months worth of data) 
>
> Now if I evaluate this query by doing this: 
>
> if qs: 
>    qs=qs.filter(a weeks worth of data inside that month) 
>
> Why does the second filter not just search the objects inside that first 
> queryset?  And is there a way to do just that?  Essentially I'm trying to 
> avoid hitting the database again.   
> I'm using Django 1.3.4 with MySQL if that matters. 
>
> Thanks in advance for any replies. 
>
> JG 
>
> Sent from my iPhone

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d6836bf3-39f4-41bf-a5c5-bd6ffb63ca52%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to