From: Felix <fel...@te...> - 2006-05-27 11:51:55
|
Hi !! what happens here ?? class Table(SQLObject): class sqlmeta: fromDatabase=3DTrue name =3D StringCol() Now, This works: var =3D '=F1' Table(name=3Dvar) But this doesn't works: var =3D u'=F1' Table(name=3Dvar) with this traceback: Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobjec= t/main.py", line 1183, in __init__ self._create(id, **kw) File "/usr/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobjec= t/main.py", line 1207, in _create self.set(**kw) File "/usr/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobjec= t/main.py", line 1068, in set kw[name] =3D dbValue =3D from_python(value, self._SO_validatorState) File "/usr/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobjec= t/col.py", line 498, in from_python return value.encode("ascii") UnicodeEncodeError: 'ascii' codec can't encode character u'\xe7' in positio= n 0: ordinal not in range(128) I need to store unicode strings what can i do ? |