[web2py] Re: need help with this DB query using LIKE AND with DAL

2010-01-20 Thread Mandriluy
http://www.youtube.com/watch?v=jGuW43sdv6E On 21 ene, 00:38, Mandriluy wrote: > I bought a screencast software last month, i use it today and made a > screencast of this but a simple version with some changes. Im > uploading right now to youtube, i hope you like it and i apologize for > my englis

[web2py] Re: need help with this DB query using LIKE AND with DAL

2010-01-20 Thread Mandriluy
I bought a screencast software last month, i use it today and made a screencast of this but a simple version with some changes. Im uploading right now to youtube, i hope you like it and i apologize for my english.. im not pro :P Btw , i also publish the screencast code version in web2pyslices.com

[web2py] Re: need help with this DB query using LIKE AND with DAL

2010-01-20 Thread mdipierro
Thank you. I suggest you post it as a slice on web2pyslices.com On Jan 20, 12:16 pm, Mandriluy wrote: > Thank you very much massimo for your help :-) .. i did make some minor > changes to the code to make it work. > > I will post here the code translated to english because maybe it could > help s

[web2py] Re: need help with this DB query using LIKE AND with DAL

2010-01-20 Thread Mandriluy
Thank you very much massimo for your help :-) .. i did make some minor changes to the code to make it work. I will post here the code translated to english because maybe it could help someone with the same problem, this code is a working ajax live search with web2py, if you dont have a multiple va

[web2py] Re: need help with this DB query using LIKE AND with DAL

2010-01-20 Thread mdipierro
OK items = [DIV(A(pacient.nombre, _href="res%s"%j, _onclick="copyToBox(jQuery('#res%s').html ()"%j),_id="resultLiveSearch") \ for (j,patience) in enumerate(pacientes)] return TAG[''](*items) On Jan 20, 11:11 am,

[web2py] Re: need help with this DB query using LIKE AND with DAL

2010-01-20 Thread Mandriluy
Sorry to reply again, i correct some mistakes i found and now is working :-) thing is.. with that method you make a hole div with the items.. what i need is a div per item . [div]item[/div] On 20 ene, 14:45, mdipierro wrote: > I rearranged your code to make is a little shorter, faster and > elimi

[web2py] Re: need help with this DB query using LIKE AND with DAL

2010-01-20 Thread Mandriluy
I copy/paste it but it didnt work.. as i said before im new to python.. i just now basic stuff.. what you wrote was quite complex to me, im going to study de code, it will help a lot if you can comment line by line what you did. I will really appreciate that :-) Thanks a lot! On 20 ene, 14:45, md

[web2py] Re: need help with this DB query using LIKE AND with DAL

2010-01-20 Thread mdipierro
I rearranged your code to make is a little shorter, faster and eliminate XSS vulnerability: def ajaxlivesearch(): resultadoParcial = request.vars.values()[0] array = resultadoParcial.split() query = reduce(lambda a,b:a&b, [db.Paciente.like('%'+a+'%') for a in array])