I'm crossposting to the SQLObject list, because I'm certain that Oleg
or Ian will likely find a hole in my suggestion.

On 4/18/06, Jason Chu <[EMAIL PROTECTED]> wrote:
> I'm in the midst of trying to deploy our first public release and I'm
> running into a problem that has been mentioned before.

I'm certain we can find a solution, let's see how optimal we can make it.

> Every time I try to log in, the byUserId (or by_user_name) query
> generated by identity fails with this traceback:
>
> Traceback (most recent call last):
[SNIP!]
> "/home/jchu/coding/sqlobject/trunk/sqlobject/dbconnection.py", line
> 306, in _executeRetry return cursor.execute(query) TypeError: argument
> 1 must be str, not unicode
>
> I am using sqlobject 0.8 dev in both cases, but my understanding is
> that the sqlobject by* methods don't like unicode, even though all of
> our strings are unicode everywhere.

My suggestion here is that the by* methods should call the column's
validator.from_python method. In the case of a UnicodeCol, this would
do the proper encoding. In the case of something like a PickleCol, the
request value would get pickled before comparison.

It seems to make sense to me.

Kevin


-------------------------------------------------------
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&kid0944&bid$1720&dat1642
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to