[SQLObject] Re: [TurboGears] Problem with TG 0.9a4 (and trunk), identity, and postgres
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Kevin D. <da...@gm...> - 2006-04-18 19:52:32
|
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 <jc...@xe...> 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 |