Is just what I am doing, this is the code:
def index():response.flash = T("Hello World")form = SQLFORM.factory(
Field('name', requires=IS_NOT_EMPTY()), Field('test', 'list:string'),)
form.vars.test = ['asdasd','2435345']
if form.process().accepted:response.flash = form.vars.name
return dict(message=T('Welcome to web2py!'), form=form)
But my test field keeps empty.
Greetings.
El 18/04/16 a las 10:56, 'DenesL' via web2py-users escribió:
You would use a list.
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#list--type--and-contains
On Monday, April 18, 2016 at 9:27:13 AM UTC-4, Carlos Cesar Caballero
wrote:
Hi, I am trying to pre-populate a form who has a list:string
field, but
if I pass a list to form.vars.my_list_field it keeps empty, And if
I try
something like "|value1|value2|value3|" just the first field of
the list
is filled with that string. How can I pre-populate a list:string
field?
Greetings.
--
Este mensaje le ha llegado mediante el servicio de correo
electronico que ofrece Infomed para respaldar el cumplimiento de
las misiones del Sistema Nacional de Salud. La persona que envia
este correo asume el compromiso de usar el servicio a tales fines
y cumplir con las regulaciones establecidas
Infomed: http://www.sld.cu/
--
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]
<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.
--
Este mensaje le ha llegado mediante el servicio de correo electronico que
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema
Nacional de Salud. La persona que envia este correo asume el compromiso de usar
el servicio a tales fines y cumplir con las regulaciones establecidas
Infomed: http://www.sld.cu/
--
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/d/optout.