I don't think the GAE datastore supports text search (you can use .contains 
on a list:-type field, though).

Anthony

On Wednesday, June 22, 2016 at 3:51:44 AM UTC-4, PRACHI VAKHARIA wrote:
>
>
>
>
>
> *PROBLEM WITH .CONTAINS() ON GAE*
>
> The following function does not work on GAE – the line in Red.
>
> *MODEL*
>
> *htmlDB.define_table('Articles',*
> *    Field('Title'),*
> *    Field('HtmlBody', 'text', label="Enter Full Article"),*
> *    Field('Abstract', 'text', label="Enter Abstract"),*
> *    Field('Author'),*
> *    format='%(Title)s'*
> *    )*
>
>
> *CONTROLLER FUNCTION*
>
>
>
>
>
>
>
>
> *def HomeList():    if request.args(0):        AuthorQuery = 
> htmlDB.Articles.Author.contains(request.args(0))        List = 
> htmlDB(AuthorQuery).select(htmlDB.Articles.ALL, 
> orderby=~htmlDB.Articles.Dated)    else:        List = htmlDB().select( 
> htmlDB.Articles.ALL, orderby=~htmlDB.Articles.Dated, limitby=(0, 2) )    
> return dict(List=List)*
>
>
>
> For a URL like this
> *http://........../HomeList.html/AUTHOR NAME*
> The controller much check if the 'AUTHOR NAME' is in the *htmlDB.Articles*
>
>
> How to make *.contains()* work on *GAE*?
>
>
> *Please help and guide. Thank you.*
> — PRACHI —
>
>
>
>
> .
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to