In DAL queries, you must use &, |, ==, and ~ rather than "and", "or", "is", and "not". This is because in Python, the former operators can be overloaded (in the case of the DAL, via the Expression class) but the latter cannot.
Anthony On Tuesday, March 25, 2014 8:08:40 PM UTC-4, Avi A wrote: > Hi, > i have a table with a boolean field: > > Field('f_test_is_a_clone', type='boolean', > label=T('Test is a clone')), > > And this is the query, where I don't want to return cloned tests: > > my_tests_list = db((db.t_tests.created_by == auth.user.id) & (not db. > t_tests.f_test_is_a_clone)).select() > > but it returns empty list. > What should i fix? > thanks. > -- 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.