Re: troubles with unicode

Petr Jakeš <[email protected]>
Newsgroups gmane.comp.python.sqlobject
Message-ID <CAERU-VZ9-VfDC1RCL0UYWrHVoB5MU5eiCLRSLhbEEzgtJOvx7Q@mail.gmail.com>
>
>
>   .set() converts fields to backend format using validators attached to
> the fields. UnicodeColumns are encoded to strings, but StringColumns are
> not, so when you've assigned a unicode object to a StringCol
> ._SO_update() received that unicode object which is wrong -
> ._SO_update() has to receive str. Do not assign unicode to StringCol.
>
>
Hmm... I am not getting it.

I am on the Firebird.
The database Default character set = UTF8
ALL text fields in in the table are varchar.
Why the SQLObject things some columns are UnicodeColumns and some columns
are StringColumns?

Bingo... it looks like "Mea Culpa":

Because of my laziness I am using fromDatabase = True.
But now, when I have inspected the table definitions, I have found I am
(accidentally) mixing two things together in one of the class/tables
definition (see the code bellow).
I will investigate this.

Thanks a lot.

Petr

class ProdejniMista(SQLObject):
    class sqlmeta:
        fromDatabase = True # -> nacte vse z databaze bez potreby
definice
#        columnList = True
    provozovatelMista = ForeignKey('ProvozovatelMista')
    automaty = RelatedJoin('Automaty')
    produkty = RelatedJoin('Produkty')
    nazevProdejnihoMista = UnicodeCol(dbEncoding = "utf-8")
    kontaktniOsobaJmeno = UnicodeCol(dbEncoding = "utf-8")
    kontaktniOsobaPrijmeni = UnicodeCol(dbEncoding = "utf-8")
    mesto = UnicodeCol(dbEncoding = "utf-8")
    adresa1 = UnicodeCol(dbEncoding = "utf-8")
    adresa2 = UnicodeCol(dbEncoding = "utf-8")
    psc = UnicodeCol(dbEncoding = "utf-8")
    zemDelka = UnicodeCol(dbEncoding = "utf-8")
    zemSirka = UnicodeCol(dbEncoding = "utf-8")
    telReseniPoruchy = UnicodeCol(dbEncoding = "utf-8")
    telKontaktniOsoby = UnicodeCol(dbEncoding = "utf-8")
    telKontaktniOsoby = UnicodeCol(dbEncoding = "utf-8")
    automaty = RelatedJoin('Automaty')

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
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-dev2

_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
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.