On Friday, August 4, 2017 at 11:03:04 AM UTC-4, José Leite wrote:
>
> I changed the Syntax to:
>
> db.intro_lifestyles.tourism_segment_id.contains(segment.id)
>

I assumed you wanted to find records that include segment.id as the one and 
only element in the list, in which case you should use my query with == 
rather than the above .contains (which will instead also include records 
that have additional elements in the list). Of course, .contains will work 
if you know all lists have exactly one item, but in that case, it seems 
unnecessary to be using a list:reference field.

Anthony

-- 
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.

Reply via email to