On Jun 5, 2007, at 7:01 PM, Mike Orr wrote:

>
> Not sure if this is a bug or just how SQLAlchemy works.  I have a
> table with an int field used as a boolean.  I can do a positive query
> like this:
>
>     q.filter(Incident.c.is_top)    =>  WHERE `IN_Incident`.is_top
>
> But a negative query does not work:
>
>     q.filter(not Incident.c.is_top)   =>  [no where clause]
>
> Though it works if I do it like this:
>
>     q.filter(Incident.c.is_top)  =>  WHERE `IN_Incident`.is_top = 0
>
> Is this the intended behavior?  What are 'not COLUMN' expressions
> supposed to do?

we dont have any way to get at the "not" expression and change what  
it returns.  but we do override "~" (__invert__()) to provide SQL  
negation:

q.filter(~Incident.c.is_top)




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to