Re: [web2py] Re: field in list test

2016-09-20 Thread Yoel Benitez Fonseca
Thanks Anthony ... I'm sorry say but can not remember for what i needed that code snippet thanks any way.. is good to know that stuff. 2016-09-16 17:02 GMT-04:00 Anthony : > This is a quirk of Field objects. Field inherits from Expression, and the > __eq__ method of Expression returns a Quer

[web2py] Re: field in list test

2016-09-16 Thread Anthony
This is a quirk of Field objects. Field inherits from Expression, and the __eq__ method of Expression returns a Query object (rather than testing for equality and returning a boolean). So, if you do something like myfield == some_object, you do not actually get a test of whether myfield is equi

[web2py] Re: field in list test

2016-09-16 Thread Dave S
On Friday, September 16, 2016 at 9:41:28 AM UTC-7, Yoel Benitez Fonseca wrote: > > Does this make sense to you? > Yes. > > In [1]: fields = list() > > In [2]: f = db.item.id > > In [3]: f in fields > Out[3]: False > > In [4]: fields.append(f) > > In [5]: f in fields > Out[5]: True >