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 —
.