Il 15/10/2012 11:19, lyn2py ha scritto:
The field (*db.bins.tags_id*) has contents of a list:reference type,
i.e. *|1|2|6|8|*
I need to get it into a list (i.e. *[1,2,6,8]*) to be used in a DAL
.select(). How should I do this?
My code:
|
rows = db(db.bins.id>1).select(
left=db.notes.on(
(db.notes.tags_id.contains((*db.bins.tags_id*).split('|')) )
)
|
As you can see, I tried to use the python split, but it returned an
error. Any tips on how to proceed to make this work?
maybe it's better you have a look at it:
http://web2py.com/books/default/chapter/29/06#Many-to-many,-list:<type>,-and-contains
<http://web2py.com/books/default/chapter/29/06#Many-to-many,-list:%3Ctype%3E,-and-contains>
hope it could help
Cheers
M.
Thanks!
--
--