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:[EMAIL PROTECTED]
> /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:[EMAIL
PROTECTED]/test')
Oleg.
--
Oleg Broytmann http://phd.pp.ru/ [EMAIL PROTECTED]
Programmers don't die, they just GOSUB without RETURN.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss