I´m working with the wiki example like this
return dict(form=FORM(INPUT(_id='keyword',_name='keyword',
_onkeyup="ajax('bg_find', ['keyword'], 'target');")),
target_div=DIV(_id='target'))
def bg_find():
pattern = '%' + request.vars.keyword.lower() + '%'
pages = db(db.articulo.body.lower().like(pattern)
).select(orderby=db.article.date)
items = [A(row.header, _href=URL('show', args=row.id)) for row in pages]
return UL(*items).xml()
And is working fine, but could I mix two queries in pages I mean, like this:
pages = db((db.article.body.lower().like(pattern)) |
(db.article.header.lower.like(pattern)) ).select(orderby=db.article.date)
??
I've tried but the example just stops workin (no error)
On Sat, Jul 23, 2011 at 3:37 PM, Web2Py Freak <[email protected]>wrote:
> OR if You Want YOU can Check this search plugin
> http://www.web2pyslices.com/slices/take_slice/115