requires=IS_IN_LIST([ngotype])),

should be


requires=IS_IN_SET(ngotype]),


On Saturday, 7 December 2013 05:35:12 UTC-6, Dreamer wrote:
>
> ngotype = 
> ['Education','Environment','Food','Health','Makewish','Orphanage','Water','Women']
> db.define_table('ngo',
>                 Field 
> <http://127.0.0.1:8000/examples/global/vars/Field>('ngo_type',requires=IS_IN_LIST([ngotype])),
>                 Field 
> <http://127.0.0.1:8000/examples/global/vars/Field>('ngo_name', 'text'),
>                 Field 
> <http://127.0.0.1:8000/examples/global/vars/Field>('contact_person','text'),
>                 Field 
> <http://127.0.0.1:8000/examples/global/vars/Field>('email', 'reference 
> auth_user'),
>                 Field 
> <http://127.0.0.1:8000/examples/global/vars/Field>('telephone','integer'),
>                 Field 
> <http://127.0.0.1:8000/examples/global/vars/Field>('established', 'date'),
>                 Field 
> <http://127.0.0.1:8000/examples/global/vars/Field>('visiting_time', 'text'),
>                 Field 
> <http://127.0.0.1:8000/examples/global/vars/Field>('about_ngo','text'),
>                 Field 
> <http://127.0.0.1:8000/examples/global/vars/Field>('activities', 'text'),
>                 Field 
> <http://127.0.0.1:8000/examples/global/vars/Field>('impact', 'text'),
>                 Field 
> <http://127.0.0.1:8000/examples/global/vars/Field>('no_dependents','integer'),
>                 Field 
> <http://127.0.0.1:8000/examples/global/vars/Field>('images','upload'),
>                 Field 
> <http://127.0.0.1:8000/examples/global/vars/Field>('event_date','date'),
>                 auth.signature)
>
> I wish to implement a multiselect option for a reqistering ngo through 
> IS_IN_LIST, i could include the whole list within the table i.e. 
> requires=IS_IN_LIST(['first','second']) however i want to provide an option 
> to the registrar to add a to a list thats why i have defined 
>
> ngotype = 
> ['Education','Environment','Food','Health','Makewish','Orphanage','Water','Women']
>
> please suggest what can i do to enable a multiselect and also allow 
> registrars to add the ngo type just in case it dont happen be in the list. or 
> do i use the IS_IN_DB()
>
> Thanks in advance.
>
>

-- 
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].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to