On Mon, Apr 17, 2006 at 05:20:59PM +0300, Max Ischenko wrote:
> class T1(SQLObject):
>     name = UnicodeCol(length=40, alternateID=True)
> 
> And the following expression:
> >>> list(T1.select(T1.q.name==u'Greek \u03a9'))
> 
> Yields an error with MySQL and works just fine for sqlite and PostgreSQL.
> I guess that's because MySQL Python driver cannot handle unicode queries
> while others can.

   Others cannot, too. The query will choke on SQLite.

> The question is whether this behavior will be continued forever or has a
> chance to be fixed (either in current codebase or in SQLObject 2).

   I would very much like to fix the feature. Actually I have been spending
last few days to think about it. Unfortunately it's a hard task in the
current codebase. I think I need to start a 0.9-branch and do a lot of
changes in the SQLObject internals to fix this "minor" problem.
   Technical details. The path to the solution is to join converters.py
into col.py, and make .__sqlrepr__() more intelligent so them can convert
values taking into account column types. Actually .__sqlrepr__() should
just use col.from_python().

> Oleg said before that this is a "feature".

   Never. It is a wart, a very unhappy misfeature.

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            [EMAIL PROTECTED]
           Programmers don't die, they just GOSUB without RETURN.


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to