*Hi,
Im trying to create a simple search function like this:*
*def search():
form_search = SQLFORM.factory(
Field('nome', requires=IS_NOT_EMPTY()))
if form_search.accepts(request.vars, session=None, keepvalues=True):
redirect(URL(r=request, f='search?nome=%s'%form_search.vars.nome))
try:
nome=request.vars['nome']
except:
nome=None
webgrid = local_import('webgrid')
grid = webgrid.WebGrid(crud)
grid.pagesize = 10
if nome:
grid.datasource =
db(db.paciente.nome.upper().like('%'+nome.upper()+'%')).select()
....*
*When I submit the form it search normally for the string that I've put on
"nome" field, but if I search it again it creates a list o
request.vars.nome.
Example:
First search: http://127.0.0.1:8000/app/default/search?nome=Test
Second search:
http://127.0.0.1:8000/app/default/search?nome=[%27Test%27,%20%27test2%27]
Is that expected?*
--
Linux User #387870
.........____
.... _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:_______
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en.