We do support something silimilar: db(Query(db, db._adapter.EQ, db.mytable.myfield, value))>select()
but it is not advertised because this is an internal issue and do not promise backward compatibility. We also support >>> e = Expression(db,"mytable.myfield LIKE 'value' ") >>> db(db.mytable)(e)._select() Where expression can be anything. On Dec 18, 7:09 am, Alan Etkin <spame...@gmail.com> wrote: > And what if DAL supported statements like this? I think it doesen't by > now: > > db(Query(db.mytable.myfield, "mystringoperator", myvalue)).select() > > Would that be a possible to implement, enhanced way of querying the > database for the framework? > Does it follows B. Will A option? > > On 17 dic, 16:18, Massimo Di Pierro <massimo.dipie...@gmail.com> > wrote: > > > > > > > > > I am reading this over and over... "a == b is a boolean". I know what > > you mean but it may be confusing to other users so I will clarify. > > It is a boolean when a and b have values, else it is just an > > expression. In dal, "a==b" is a query (an expression) that is > > evaluated on every record and if it returns true the record is > > selected (not unlike SQL). > > > So in > > > db(a == b).select() or the proposed (a==b).select() > > > (a==b) does not return a boolean. > > > Massimo > > > On Dec 17, 11:36 am, Alan Etkin <spame...@gmail.com> wrote: > > > > > @Alan Etkin > > > > Actually, (db.mytable.id == 3) is neither a tuple or a bool. The == > > > > operator used on a field returns a Query object. > > > > Yes, you are right, what i was trying to say is that this: > > > > (a == b).select() > > > > is more confusing to me than the normal web2py instruction because in > > > a python program the above sentence should call a method of a bool > > > object: > > > > "...Comparisons yield boolean values: True or False..."