Yes.
You can make it work (sort of) if you edit gluon/sqlhtml.py and
replace
rows = self.db(field.like(self.request.vars[self.keyword]
+'%'))\
.select(orderby=self.orderby,limitby=self.limitby,*self.fields)
with
rows = self.db(field>=self.request.vars[self.keyword])\
(field<=self.request.vars[self.keyword]
+chr(126))\
.select(orderby=self.orderby,limitby=self.limitby,*self.fields)
It will work but case will have to be exact.
The problem is, as usual, gae does not allow searching substrings.
On Oct 3, 8:33 pm, Tito Garrido <[email protected]> wrote:
> I'm trying to use autocomplete widget
> (http://web2py.com/book/default/chapter/07#Autocomplete-Widget) on GAE and
> I'm receiving this error:
> Traceback (most recent call last):
> File
> "/Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/restricted.py",
> line 188, in restricted
> exec ccode in environment
> File
> "/Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/applications/init/models/db.py",
> line 171, in <module>
> db.user_jogo.jogo.widget = SQLFORM.widgets.autocomplete(request,
> db.jogo.nome, id_field=db.jogo.id)
> File
> "/Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/sqlhtml.py",
> line 473, in __init__
> self.callback()
> File
> "/Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/sqlhtml.py",
> line 479, in callback
> rows = self.db(field.like(self.request.vars[self.keyword]+'%'))\
> File
> "/Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/contrib/gql.py",
> line 140, in __call__
> return Set(self, where)
> File
> "/Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/contrib/gql.py",
> line 639, in __init__
> self._tables = [filter.left._tablename for filter in where.filters]
> AttributeError: 'Query' object has no attribute 'filters'
>
> Is it expected?
>
> Regards,
>
> Tito
>
> --
>
> Linux User #387870
> .........____
> .... _/_õ|__|
> ..º[ .-.___.-._| . . . .
> .__( o)__( o).:_______