I needed a IS_IN_DB() validator based on joined tables with the id coming 
from one
table and the label coming from both tables, since I did not get this to 
work I tried:

table.labelIDs.requires = IS_EMPTY_OR(IS_IN_SET([(r.ntw_edge_label_set.id, 
'%s' %str(r.vtx_vertex.name + ' - ' +  r.ntw_edge_label_set.myLabel)) for r 
in rows], multiple=(0, 6), zero='Select a value'))

This works but in my opinion this is rather ugly:

'%s' %str(r.vtx_vertex.name + ' - ' +  r.ntw_edge_label_set.myLabel)) for r 
in rows

Is there a way to improve this code?


Kind regards,

Annet.

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