Re: Parsing a complex query with many parentheses, ORs, ANDs, and (hopefully) NOTs

2008-11-21 Thread Michael Keselman
On Nov 21, 2008, at 11:46 PM, Malcolm Tredinnick wrote: > > > On Fri, 2008-11-21 at 22:37 -0500, Michael Keselman wrote: >> Hello, >> >> http://pastie.org/private/xvqf5tgjnimiolakhawgg (relevant code) >> >> Django's QuerySets allow you to do ORs (unions) pretty nicely with >> Model.manager.filte

Re: Parsing a complex query with many parentheses, ORs, ANDs, and (hopefully) NOTs

2008-11-21 Thread Malcolm Tredinnick
On Fri, 2008-11-21 at 22:37 -0500, Michael Keselman wrote: > Hello, > > http://pastie.org/private/xvqf5tgjnimiolakhawgg (relevant code) > > Django's QuerySets allow you to do ORs (unions) pretty nicely with > Model.manager.filter(Q(...) | Q(...)). However, ANDs don't work quite > as nicely

Parsing a complex query with many parentheses, ORs, ANDs, and (hopefully) NOTs

2008-11-21 Thread Michael Keselman
Hello, http://pastie.org/private/xvqf5tgjnimiolakhawgg (relevant code) Django's QuerySets allow you to do ORs (unions) pretty nicely with Model.manager.filter(Q(...) | Q(...)). However, ANDs don't work quite as nicely in my situation because I want AND to do what Model.manager.filter(Q(...