but db((db.progs.promo==True)).select(): is work!
понедельник, 9 марта 2015 г., 16:58:26 UTC+3 пользователь Niphlod написал: > > for the same exact reason. > > NOT field = True > > in t-sql means just FALSE, not FALSE and NULL > > On Monday, March 9, 2015 at 2:37:46 PM UTC+1, Dmitry Ermolaev wrote: >> >> I use negate - why this not worked? >> >> воскресенье, 8 марта 2015 г., 23:15:49 UTC+3 пользователь Niphlod написал: >>> >>> booleans in T-SQL are not treated the same way as python..... in T-SQL, >>> NULL values are neither True or False, they are just NULL. >>> >>> So, if you want closed either None or False, you should do >>> >>> ((db.progs.closed == None) | (db.progs.closed == False)) >>> >>> one shortcut to it would be >>> >>> db.progs.closed.belongs((None, False)) >>> >>> that'll turn this syntax to the previous one, effectively selecing both >>> None and False values. >>> >>> On Sunday, March 8, 2015 at 7:23:54 PM UTC+1, Dmitry Ermolaev wrote: >>>> >>>> db((db.progs.promo==True) & (db.progs.closed!=True)).select(): >>>> or >>>> db((db.progs.promo==True) & ~(db.progs.closed==True)).select(): >>>> >>>> >>>> not worked (( >>>> if exist record wirh promo=True and closed=None or False - it not >>>> selected! >>>> >>> -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.