Hi,

I can see that tables and fields are allowed in DAL and Set:

   DAL
         db(db.table)
         db(db.table.field)

   Set
         db(...)(db.table)
         db(...)(db.table.field)

They are automatically converted to valid Query objects in the respective 
__call__ functions.

But the same (tables and fields) is not valid in Query:

   Query
         db( (...) & (db.table) )
         db( (...) | (db.table) )
         db( (...) & (db.table.field) )
         db( (...) | (db.table.field) )

Web2py does not automatically convert/correct queries via & and |.

I propose to include the following at the very beginning of Query.__init__ 
function:

        if isinstance(second,Table):
            second = second._id>0
        elif isinstance(second,Field):
            second = second!=None

Thanks,

   Carlos

Reply via email to