From: Oleg B. <ph...@ph...> - 2008-01-07 17:44:58
|
On Mon, Jan 07, 2008 at 12:35:40PM -0500, Glenn MacGregor wrote: > #!/usr/bin/python > # -*- coding: utf-8 -*- > > import os, sys, glob MySQLdb > from sqlobject import * > > sqlhub.processConnection = connectionForURI('mysql://test:test@localhost > /test?charset=utf8&use_unicode=1 > > class Temp(SQLObject): > class sqlmeta: > table = "temp" > fromDatabase = True > > def add(label): > return Temp(label=label) > > add = staticmethod(add) > > > a = 'Ch?rie' > > t = Temp.add(a) > > print 'Done' Declare the column as non-unicode: class Temp(SQLObject): class sqlmeta: table = "temp" fromDatabase = True label = StringCol() Or stop using unicode at all: sqlhub.processConnection = connectionForURI('mysql://test:test@localhost/test') Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |