Re: Using .filter() on a constant expression

2011-10-21 Thread Tim Chase
On 10/21/11 13:58, Ian Clelland wrote: If you don't want to do that, then just use python to selectively include or exclude the other Q objects (that you wanted to depend on your comparison): Using your code as a base, I would do something like this: (I don't know if this is correct; I get a hea

Re: Using .filter() on a constant expression

2011-10-21 Thread Ian Clelland
On Sat, Oct 15, 2011 at 9:52 PM, Tim Chase wrote: > I have some gnarly AND/OR logic combining Q() objects but deep > within the logic, I need to do a comparison of two constants. In an ideal > world, the logic would look something like > > def age(self, age): > ... & Q(12=as_of.month) & ...

Using .filter() on a constant expression

2011-10-15 Thread Tim Chase
I have some gnarly AND/OR logic combining Q() objects but deep within the logic, I need to do a comparison of two constants. In an ideal world, the logic would look something like def age(self, age): ... & Q(12=as_of.month) & ... but that's invalid python. I *can* break out this rats