Hi Anthony and Richard,
Thank you both for your replies
It's probably a good idea to strip any leading/trailing whitespace before
> the names are ever inserted in the database.
>
To solve the issue I use .strip()
Kind regards,
Annet
--
Resources:
- http://web2py.com
- http://web2py.com/bo
It's probably a good idea to strip any leading/trailing whitespace before
the names are ever inserted in the database.
Anthony
On Wednesday, November 16, 2016 at 9:28:56 AM UTC-5, Richard wrote:
>
> Here what I usually do for search in user field name :
>
> search_val = request.vars.txtSearch
>
Here what I usually do for search in user field name :
search_val = request.vars.txtSearch
rows = db(((db.auth_user.registration_key != 'disabled') |
(db.auth_user.registration_key == None)) &
(db.auth_user.first_name.lower().like('%{0}%'.format(search_val.lower( |
((db.auth_use
.strip()
Richard
On Wed, Nov 16, 2016 at 2:29 AM, 'Annet' via web2py-users <
web2py@googlegroups.com> wrote:
> I have a form in which the user enter his name, for example: 'Thompson,
> Brian'
>
> When I execute the following query:
>
> rowset = db(db.vtx_vertex.name.ilike(nameform.vars.name))
>
I have a form in which the user enter his name, for example: 'Thompson,
Brian'
When I execute the following query:
rowset = db(db.vtx_vertex.name.ilike(nameform.vars.name))
This query return the correct result.
However, when db.vtx_vertex.name is 'Thompson, Brian ' (a space after Brian)
and na
5 matches
Mail list logo