Re: [SQLObject] Query using ends with

2008-10-04 Thread Oleg Broytmann
On Wed, Oct 01, 2008 at 04:27:41PM -0300, Leandro Sales wrote: > > from sqlobject.sqlbuilder import SQLConstant > it worked, but just as following: > > from sqlobject.sqlbuilder import SQLConstant > domain = > Domain.select(SQLConstant("'www.domain1.com'").endswith(Domain.q.name)) > > Note th

Re: [SQLObject] Query using ends with

2008-10-04 Thread Leandro Sales
I'd like a sqlobject query that does: Domain table: id name 1domain1.com 2domain2.com 3domain3.com hostname = 'www.domain1.com' SELECT * FROM domain WHERE hostname LIKE CONCAT('%', name); or in a similar way: SELECT * FROM domain WHERE LOCATE(name, hostname); The

Re: [SQLObject] Query using ends with

2008-10-04 Thread Leandro Sales
On Wed, Oct 1, 2008 at 4:11 PM, Oleg Broytmann <[EMAIL PROTECTED]> wrote: > On Wed, Oct 01, 2008 at 03:41:09PM -0300, Leandro Sales wrote: >> qname = "www.domain1.com" >> domain = Domain.select("""'""" + qname + """' LIKE CONCAT('%', >> domain.name)""") > > from sqlobject.sqlbuilder import SQLCons

[SQLObject] Query using ends with

2008-10-04 Thread Leandro Sales
Hello. Please consider the following: I have a sqlobject object named Domain that stores the list of available domains: class Domain(SQLObject): name = StringCol(alternateID=True, length=255, default=None) In the database I have domains like: IDname -- 1 domai

Re: [SQLObject] UnicodeEncodeError

2008-10-04 Thread Oleg Broytmann
On Sun, Sep 28, 2008 at 06:20:02PM +0200, Markus W. Barth wrote: > I have run into that before and can't remember how I got around it: > > UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' > > This is what I'm trying to do: > solicitud = model.Solicitud(lugar_nacimiento = > k