Re: Unicode probs...

Oleg Broytman <[email protected]>
Newsgroups gmane.comp.python.sqlobject
Message-ID <[email protected]>
On Tue, Feb 28, 2012 at 01:56:50PM -0500, Markos Kapes wrote:
> 	Out[21]: Title is: title names are:  [u'publisher', u'isbn', 'kind_id', 'booktitle', u'release_date', u'edition', u'tag', u'type']  values are: [' ', ' ', 1, '\xc3\xa9tape', None, None, None, None]
> So, yes, there are unicode strings in the names.

   To fix that edit sqlobject/mysql/mysqlconnection.py, method
columnsFromSchema; search for assignments

kw['name'] = soClass.sqlmeta.style.dbColumnToPythonAttr(field)
kw['dbName'] = field

   make them strings:

kw['name'] = str(soClass.sqlmeta.style.dbColumnToPythonAttr(field))
kw['dbName'] = str(field)

   test and report if that helps.

Oleg.
-- 
     Oleg Broytman            http://phdru.name/            [email protected]
           Programmers don't die, they just GOSUB without RETURN.

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.