On Mar 20, 2009, at 4:40 AM, jo wrote:
> > > > > Michael Bayer ha scritto: >> On Mar 19, 2009, at 12:34 PM, jo wrote: >> >> >>> Michael Bayer wrote: >>> >>>> why dont you just stick with None instead of "nn" ? then you just >>>> write: >>>> >>>> if v is None: >>>> clause.append(self.c.field != v) >>>> else: >>>> clause.append(self.c.field == v) >>>> >>> It could be an idea but not intuitive and unnatural >>> >>> because None = IS NOT NULL (very ugly) :-( >>> and null() = IS NULL >>> >> >> well the logic you're doing above seems unnatural all by itself, that >> if v is NULL you want a NOT NULL. that would seem just as >> "unnaturual" using "null()" as "None". >> >> just make yourself a notnull = not_(null()) and problem solved. >> >> > the hint you suggested me doesn't work because SQLAlchemy translate it > to " = (NOT NULL) " which is invalid sql... > sqlalchemy produces IS NOT NULL using the != operator in conjunction with None or null(). I don't see a reason to add another way of doing the same thing. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
