Re: [web2py] Re: CONTAINS() takes exactly 3 arguments (2 given)

2012-11-07 Thread apps in tables
Thank you, Villas. --

Re: [web2py] Re: CONTAINS() takes exactly 3 arguments (2 given)

2012-11-06 Thread villas
I would just try to play around with the callback function... def callback(): query = (db.page.id == db.comment.page_id) \ ( (db.page.title.contains(request.vars.keyword) | \ (db.comment.body.contains(request.vars.keyword) ) pages =

Re: [web2py] Re: CONTAINS() takes exactly 3 arguments (2 given)

2012-11-06 Thread apps in tables
Thank you vilas, I think my question is not clear enough for me. I mean: 1- searching page and comment may mean searching the result of joining the two tables, which will lead to repetition of the found page (# of repetitions are the number of associated comments). can 'distinct' solve

Re: [web2py] Re: CONTAINS() takes exactly 3 arguments (2 given)

2012-11-06 Thread villas
Hi Askraf, I added the 'distinct' clause to stop any repeated rows, so yes I think that would help. Much depends how you wish to present the results. If you are happy for a simple list of page titles, then what I proposed seems reasonable. I thought you might be showing a link to each

[web2py] Re: CONTAINS() takes exactly 3 arguments (2 given)

2012-11-02 Thread apps in tables
Hi, Let me rephrase the question. This query query = db.talab.body.contains(request.vars.keyword) | db.talab.title.contains(request.vars.keyword) is working fine. But, this query query = ( ((db.talab.id == db.talab_comment.talab_id) (db.talab.id == db.talab_document.id)) (

[web2py] Re: CONTAINS() takes exactly 3 arguments (2 given)

2012-11-02 Thread apps in tables
Hi Massimo, I replaced *request.vars.keyword with **request.vars.keyword or ''* it did give me a blank page ( empty ) no error. you are getting closer. On Friday, November 2, 2012 4:32:43 PM UTC+3, Massimo Di Pierro wrote: Can you check the value of *request.vars.keyword*

Re: [web2py] Re: CONTAINS() takes exactly 3 arguments (2 given)

2012-11-02 Thread Richard Vézina
Test you double table query with real value instead of using request.vars.keyword... Pass the keyword you know are good directly to make sure if your query is correct first and then you try to figure out why it not working with request. So instead of : query = ( ((db.talab.id ==

Re: [web2py] Re: CONTAINS() takes exactly 3 arguments (2 given)

2012-11-02 Thread apps in tables
Hi, Let us start from the reference ( web2py book ajax search example) def search(): an ajax wiki search page return dict(form=FORM(INPUT(_id='keyword',_name='keyword', _onkeyup=ajax('callback', ['keyword'], 'target');)), target_div=DIV(_id='target')) def

Re: [web2py] Re: CONTAINS() takes exactly 3 arguments (2 given)

2012-11-02 Thread Richard Vézina
Ashraf, Try split your problem into small pieces. First make sure your query is working, then try to use request, then think about ajax. Richard On Fri, Nov 2, 2012 at 12:36 PM, apps in tables ad...@aqar-riyadh.comwrote: Hi, Let us start from the reference ( web2py book ajax search example)

Re: [web2py] Re: CONTAINS() takes exactly 3 arguments (2 given)

2012-11-02 Thread apps in tables
Thank you Richard, I understand and value your approach very much. I would like to know from the designers of web2py, if what i am trying to do is doable or not ? (currently, I am not able to add feature to web2py by myself) After getting the answer,I will start attacking the problem using

Re: [web2py] Re: CONTAINS() takes exactly 3 arguments (2 given)

2012-11-01 Thread Richard Vézina
Not sure, but the request.vars.VAR is text type even if your value is integer, so maybe there is a check to do there. Richard On Thu, Nov 1, 2012 at 1:25 PM, apps in tables ad...@aqar-riyadh.comwrote: I got the same error with VERSIONweb2py™(2, 2, 1, datetime.datetime(2012, 10, 21, 16, 57,

[web2py] Re: CONTAINS() takes exactly 3 arguments (2 given)

2012-11-01 Thread Massimo Di Pierro
I do not know. Anyway, you are using 2.0.9. Can you upgrade to 2.2.1? On Thursday, 1 November 2012 12:07:41 UTC-5, apps in tables wrote: Hi, I did small changes to the example in the book (ajax search), @auth.requires_login() def searchtalab(): an ajax wiki search page return

[web2py] Re: CONTAINS() takes exactly 3 arguments (2 given)

2012-11-01 Thread apps in tables
I got the same error with version 2.2.1 Ashraf --

[web2py] Re: CONTAINS() takes exactly 3 arguments (2 given)

2012-11-01 Thread apps in tables
I only made the query based on more than one table, and that caused the problem. --

[web2py] Re: CONTAINS() takes exactly 3 arguments (2 given)

2012-11-01 Thread apps in tables
I only made the query based on more than one table, and that caused the problem. --

Re: [web2py] Re: CONTAINS() takes exactly 3 arguments (2 given)

2012-11-01 Thread Richard Vézina
Does it works if you remove one table from you query? Richard On Thu, Nov 1, 2012 at 3:21 PM, apps in tables ad...@aqar-riyadh.comwrote: I only made the query based on more than one table, and that caused the problem. -- --

Re: [web2py] Re: CONTAINS() takes exactly 3 arguments (2 given)

2012-11-01 Thread apps in tables
Hi Richard, yes, the search is working perfect for query based on one table. I am trying to include the details tables in the search. Any special format for the query that is based on more than one table? Regards, Ashraf On Thursday, November 1, 2012 10:28:50 PM UTC+3, Richard wrote:

Re: [web2py] Re: CONTAINS() takes exactly 3 arguments (2 given)

2012-11-01 Thread apps in tables
Hi, why is 'contains()' working fine for one table query? and not working for more than one table query? Any ideas. Regards, Ashraf --

Re: [web2py] Re: CONTAINS() takes exactly 3 arguments (2 given)

2012-11-01 Thread Richard Vézina
Try to isolate a dummy query the one that pass and the one that not pass... I don't have much time to read all your code... Richard On Thu, Nov 1, 2012 at 4:13 PM, apps in tables ad...@aqar-riyadh.comwrote: Hi, why is 'contains()' working fine for one table query? and not working for more

Re: [web2py] Re: CONTAINS() takes exactly 3 arguments (2 given)

2012-11-01 Thread apps in tables
The code is very simple. @auth.requires_login() def searchtalab(): an ajax wiki search page return dict(form=FORM(INPUT(_id='keyword',_name='keyword', _onkeyup=ajax('callbacktalab', ['keyword'], 'target');)), target_div=DIV(_id='target'))