Fix: Forgot the func.lower for the description: tipos = Tipolmovel.select(func.lower(Tipolmovel.q.description).startswith(func.lower(descricao)))
On Sep 26, 10:17 pm, Kevin <[EMAIL PROTECTED]> wrote: > After thinking about an example, I think this is what you want: > > tipos = > Tipolmovel.select(func.lower(Tipolmovel.q.description).startswith(descricao)) > > I think that will work. "func.lower" allows a case insensitive search > if you wanted that. > > On Sep 26, 9:22 pm, Leandro Severino <[EMAIL PROTECTED]> wrote: > > > Kevin, > > Do you have a example ? > > How to use this ? > > > On Sep 26, 7:00 pm, Kevin <[EMAIL PROTECTED]> wrote: > > > > Look at > > > sqlobject.sqlbuilder.LIKEhttp://www.sqlobject.org/class-sqlobject.sqlbuilder.LIKE.html > > > You and also use > > > RLIKE:http://www.sqlobject.org/class-sqlobject.sqlbuilder.RLIKE.html > > > > On Sep 26, 3:33 pm, Leandro Severino <[EMAIL PROTECTED]> wrote: > > > > > Well, > > > > I have a method to search values in a table. > > > > > The source: > > > > > def search(self, *args, **kwargs): > > > > mode = "search" > > > > sigla=kwargs["sigla"] > > > > descricao=kwargs["descricao"] > > > > if sigla: > > > > tipos=TipoImovel.selectBy(sigla=sigla) > > > > else: > > > > if descricao: > > > > tipos = > > > > TipoImovel.selectBy(description=descricao) > > > > return dict(tipos=tipos, mode=mode) > > > > > I want 'search' a description where that startswith with a > > > > specific string, for example, select all records from "TipoImovel" > > > > where the description LIKE house%, then the query return all records > > > > with de column "description" startswith "house". > > > > > How to do this ? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

