On Thursday, February 18, 2021 at 8:59:30 PM UTC-8 mostwanted wrote:

> Hi guys, I was wondering if there is a way to create checkboxes for the 
> IS_IN_DB() validator & be able to select several options at a go like I can 
> with IS_IN_SET().
>
> *Example:*
>
> db.define_table('favourites',
>                 Field('snack'),
>                 format="%(snack)s")
>
> db.define_table('person',
>                 Field('Name'),
>                 Field('favourites', 'reference favourites', 
> requires=IS_IN_DB((db, db.favourites, '%(snack)s'),multiple=True), 
> widget=SQLFORM.widgets.checkboxes.widget))
>
> If the above is not possible what can i do to achieve the same results?
>
>
>
In the Chap 7 discussion of IS_IN_BOOT,
<http://web2py.com/books/default/chapter/29/07/forms-and-validators#Database-validators>
 there's a paragraph beginning

"If you want the field validated, but you do not want a drop-down, you must 
put the validator in a list
[...] Occasionally you want the drop-down "

Does that section help with your question?

/dps


-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/6a4af5ed-4bb5-492c-9f15-91bb0ae19443n%40googlegroups.com.

Reply via email to