Thanks Massimo! I am learning a lot about the way you use lambda: in web2py.
now my search is really faster. is there any chance to do: myrows = db(......).select(....).GAELIKE('string') or myrows = db(...).select().like(string) or may be myrows = GAELIKE(db.(....).select(....),'string') pointing to you solution? than this could solve the problem. ---- I am doing this: *Search page (meta-sidebar):* <script> $('#search').keyup(function(){ ajax("{{=URL(r=request, c='plugin_wiki',f='page.load/searchpages')}}",['search'],'target'); return false; }); </script> <h2>Search</h2> <form> <input id='search' name='search'> </form> <div id='target' name='target'></div> *page/searchpages:* `` name: searchPages string: {{=request.args(1)}} nfmessage: Nothing found with the word (%s) ``:widget *the widget just as you said:* @staticmethod def searchPages(string=None,nfmessage='Nothing found with %s'): string = request.vars.search pages = db(db.plugin_wiki_page.id>0).select().find(lambda row:string and (string in row.slug or string in row.body or string in row.title) and not row.slug.startswith('meta')) if string: if pages: return '<b>Results</b></br> %s ' % UL(*[LI(A(XML(page.title),_href=URL(request.application,'plugin_wiki','page',args=page.slug))) for page in pages]) else: return nfmessage % string else: return '' ------ Sorry for going out off the post Topic Again... 2010/8/3 mdipierro <mdipie...@cs.depaul.edu> > This code is equivalent to yours, also runs on GAE, and it is faster: > > @staticmethod > def searchPages(string=None,nfmessage='Nothing found with %s'): > pages = db(db.plugin_wiki_page.id>0).select().find(lambda row: > \ > string and (string in row.slug or string in > row.body or string in row.title) and not row.slug.startswith('meta')) > if pages: > return > > UL(*[LI(A(page.title,_href=URL(request.application,'plugin_wiki','page',args=page.slug))) > for page in pages]) > else: > return '' > > > On Aug 2, 4:59 pm, Bruno Rocha <rochacbr...@gmail.com> wrote: > > Thats the way I found to perform LIKE() search in GAE, it is ugly (I > know) > > but works.. I am waiting for any feature to replace this. > > > > @staticmethod > > def searchPages(string=None,nfmessage='Nothing found with %s'): > > """ > > string: string to be found > > """ > > found = set() > > string = request.vars.search > > if string: > > #search in slug > > pages = > > db(db.plugin_wiki_page.id>0).select(db.plugin_wiki_page.slug) > > for page in pages: > > if page.slug.find(string) > -1: > > found.add(page.slug) > > > > #search in page body > > pages = > > db(db.plugin_wiki_page.id > >0).select(db.plugin_wiki_page.slug,db.plugin_wiki_page.body) > > for page in pages: > > if page.body.find(string) > -1: > > found.add(page.slug) > > > > #search in page title > > pages = > > db(db.plugin_wiki_page.id > >0).select(db.plugin_wiki_page.slug,db.plugin_wiki_page.title) > > for page in pages: > > if page.title.find(string) > -1: > > found.add(page.slug) > > > > if found: > > cleanfound = set() > > for row in found: > > if row[:4]!='meta': > > cleanfound.add(row) > > > > return UL(*[LI(*[A(XML(db(db.plugin_wiki_page.slug==row)\ > > > > .select(db.plugin_wiki_page.title)[0].title),\ > > > > _href=URL(request.application,'plugin_wiki','page',args=[row,]))])\ > > for row in cleanfound]) > > #r=request,f='page' > > else: > > return nfmessage % string > > > > else: > > return '' > > > > 2010/8/2 Martin.Mulone <mulone.mar...@gmail.com> > > > > > > > > > I use like() to search, but in a near future this could be disabled. > > > > > On Aug 2, 1:23 pm, Bruno Rocha <rochacbr...@gmail.com> wrote: > > > > Running locally InstantPress looks awesome, quickly, beauty/clean > layout > > > and > > > > I loved the way you treat Admin Buttons. > > > > > > Congratulations! > > > > > > But, this could not works on GAE, I saw a lot of code that is not > allowed > > > on > > > > GAE, you are using .like() in get_lats_pots_with_search() > > > > > > Today I will try to run it on GAE, testing some workarround, then I > > > report > > > > you. > > > > > > {{=thanks}} > > > > > > 2010/8/2 Martin.Mulone <mulone.mar...@gmail.com> > > > > > > > I don know I think yes, but I dont test it. > > > > > > > On Aug 2, 9:45 am, Bruno Rocha <rochacbr...@gmail.com> wrote: > > > > > > Martin, is it able to work on GAE ? > > > > > > > > 2010/8/2 Martin.Mulone <mulone.mar...@gmail.com> > > > > > > > > > I am working in a cms *blog style* the idea is to be simple, > ready > > > to > > > > > > > work, looking professional, and use ajax and effect in admin > panel > > > at > > > > > > > least. You can see here: > > >http://code.google.com/p/instant-press/Itis > > > > > > > in developing state but many things are working. I am working > on it > > > in > > > > > > > the last 2 or 3 weeks. All the ideas, bugs and others comments > are > > > > > > > welcome. Here where I work Iam prommoting web2py. > > > > > > > > > Can admin users. > > > > > > > Can admin articles. > > > > > > > Can admin comments. > > > > > > > Can admin categories. > > > > > > > Can admin information of the site. > > > > > > > > > On Aug 2, 7:16 am, Phyo Arkar <phyo.arkarl...@gmail.com> > wrote: > > > > > > > > Web2py is Great, Greatest framework that i had ever tried and > > > stick > > > > > onto > > > > > > > it. > > > > > > > > > > But what it is lacking is publicity and lack of KILLER > web-apps > > > like > > > > > > > those > > > > > > > > Made PHP most popular web-development platform. > > > > > > > > Here are some , what that had made PHP Popular and which will > > > also > > > > > make > > > > > > > > Web2py + Python all together more popular and makes > development > > > > > > > enviorment > > > > > > > > of Choice for web: > > > > > > > > > > Necessary APPS: > > > > > > > > > > *Database Administration:* > > > > > > > > > > phpMyAdmin - Is the Most used webbased Database Manager ever > > > > > > > > > > we have admin for web2py but that alone is not sufficient, we > > > need a > > > > > DB > > > > > > > > Admin for every Databases on the current system . > > > > > > > > Current commercial project i am doing have some features for > it > > > and > > > > > when > > > > > > > i > > > > > > > > free i will start making dedicated one . I will need > contributers > > > > > later. > > > > > > > > > > Hows about PySQLAdmin sounds? > > > > > > > > > > *File Manager :* > > > > > > > > > > Those who work on LAMP , they usually use a file manager like > > > > > net2ftp. > > > > > > > > Current my elFinder-web2py works well for this case, but i > need > > > > > > > > contributors . > > > > > > > > > > *CMS* > > > > > > > > > > KPAX exist but it is not dedicatedly maintained , we will > need > > > > > dedicated > > > > > > > > maintainers for it , lets let Massimo dedicate his works on > > > web2py. > > > > > > > > KPAX should not only be as Appliance , it should have its > own > > > Domain > > > > > and > > > > > > > > brand.And lets make it better than CMS. > > > > > > > > > > *Blog* > > > > > > > > > > There are many blog exist on the appliance , but we need a > > > dedicate > > > > > best > > > > > > > one > > > > > > > > that can go toes to toes against Wordpress. > > > > > > > > + will need A Dedicated domain , and maintainer. > > > > > > > > * > > > > > > > > * > > > > > > > > * > > > > > > > > * > > > > > > > > KILLER APP Ideas > > > > > > > > > > *Stack Overflow Clone:* > > > > > > > > > > For web2py community and as separate Open Source Project , > lets > > > make > > > > > a SO > > > > > > > > Clone? > > > > > > > > > > *Email Client:* > > > > > > > > * > > > > > > > > * > > > > > > > > Python have a very rich Built-in mail handling libs , > developing > > > a > > > > > > > > gmail-clone wont be hard at all. > > > > > > > > > > Ticketing Systems: > > > > > > > > > > Many enterprises needs a Help Desk/ Ticketing system . Best > one i > > > > > used is > > > > > > > RT > > > > > > > > (Perl based ticketing system). We can make a better one based > on > > > > > web2py. > > > > > > > > > > What i can contribute : > > > > > > > > > > I am planning to provide a site for hosting web2py app and > demos > > > for > > > > > it. > > > > > > > I > > > > > > > > have server / space and good domain (www.web2pyhost.com, > > > > > scaryhits.com) > > > > > > > or > > > > > > > > should it be web2pyapps.com > > > > > > > > for code hosting we can use google for that. > > > > > > > > > > * > > > > > > > > * > > > > > > > > -- > > > > > > > >http://rochacbruno.com.br > > > > > > -- > > > > > >http://rochacbruno.com.br > > > > -- > > > > http://rochacbruno.com.br > -- http://rochacbruno.com.br