What do you mean by "not working"? Are you getting an error or some other 
unexpected behavior? Describe what is happening and what you expect instead?

Anthony

On Wednesday, July 20, 2016 at 3:54:18 AM UTC-4, 黄祥 wrote:
>
> let say i have code
> *models/db.py*
> db.define_table('employee', 
> Field('is_auth', 'boolean'),
> Field('auth_user', 'reference auth_user'), 
> Field('full_name'), 
> Field('role'), 
> format = '%(full_name)s')
>
> auth_user_employee = db(db.employee.auth_user == 
> auth.user_id).select().first()
>
> db.define_table('client', 
> Field('name'), 
> Field('pic_it', 'list:reference employee'), 
> format = '%(name)s')
>
> # work for text type
> db.client.pic_it.requires = IS_IN_DB(db(db.employee.role.contains('IT') ), 
> db.employee.id, db.employee._format, 
> multiple = True)
> db.define_table('checklist', 
> Field('checklist_no'), 
> Field('client', 'reference client'), 
> format = '%(checklist_no)s')
>
> *# not work for list:reference type*
> *db.checklist.client.requires = 
> IS_IN_DB(db(db.client.pic_it.contains(auth_user_employee.id 
> <http://auth_user_employee.id>) ), *
> * db.client.id <http://db.client.id>, db.client._format)*
>
> why is_in_db() contains query not work for list:reference type?
> any idea to solve this?
>
> thanks and best regards,
> stifan
>

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