Re: troubles with unicode

Petr Jakeš <[email protected]>
Newsgroups gmane.comp.python.sqlobject
Message-ID <CAERU-VZ1PcTH2hGT3yN=3XuR8HG8q-gKRNWO=vb_kgi0fpRS7A@mail.gmail.com>
I thing I am few steps farther but new problem arised:


  File "/TG_web/fantomas/controllers.py", line 305, in
ulozeniProdejnihoMista
    prodMisto.set(**slovnikArgumentu)
  File
"/usr/lib/python2.5/site-packages/SQLObject-0.10.1-py2.5.egg/sqlobject/main.py",
line 1123, in set
    self._connection._SO_update(self, args)
  File
"/usr/lib/python2.5/site-packages/SQLObject-0.10.1-py2.5.egg/sqlobject/dbconnection.py",
line 512, in _SO_update
    self.query(myQuery)
  File
"/usr/lib/python2.5/site-packages/SQLObject-0.10.1-py2.5.egg/sqlobject/dbconnection.py",
line 683, in query
    return self._dbConnection._query(self._connection, s)
  File
"/usr/lib/python2.5/site-packages/SQLObject-0.10.1-py2.5.egg/sqlobject/dbconnection.py",
line 334, in _query
    self._executeRetry(conn, conn.cursor(), s)
  File
"/usr/lib/python2.5/site-packages/SQLObject-0.10.1-py2.5.egg/sqlobject/dbconnection.py",
line 329, in _executeRetry
    return cursor.execute(query)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xed' in
position 101: ordinal not in range(128)


 ============= set method start ===============
<type 'str'> telKontaktniOsoby <type 'unicode'> +420734803579
<type 'str'> kontaktniOsobaPrijmeni <type 'unicode'> Zburník
<type 'str'> nazevKontaktMistaPoruchy <type 'unicode'> recepce
<type 'str'> psc <type 'unicode'> 28835
<type 'str'> mesto <type 'unicode'> Nymburk
<type 'str'> geocodeAccuracy <type 'str'> Z
<type 'str'> adresa2 <type 'unicode'>
<type 'str'> adresa1 <type 'unicode'> Sportovní 1801
<type 'str'> zemDelka <type 'unicode'> 15.058984
<type 'str'> zemSirka <type 'unicode'> 50.178441
<type 'str'> elektrinaZaRokBezDph <type 'unicode'> 2356
<type 'str'> kontaktniOsobaJmeno <type 'unicode'> Tomáš
<type 'str'> cisloSignysPartnera <type 'unicode'> 34
<type 'str'> telReseniPoruchy <type 'unicode'> +420325517801
<type 'str'> nazevProdejnihoMista <type 'unicode'> SC Nymburk
<type 'str'> dnuRokOtevreno <type 'unicode'> 360
<type 'str'> najemZaRokBezDph <type 'unicode'> 10400

============ _SO_update start =====================
<type 'unicode'> tel_kontaktni_osoby <type 'unicode'> +420734803579
<type 'unicode'> kontaktni_osoba_prijmeni <type 'unicode'> Zburník
<type 'unicode'> nazev_kontakt_mista_poruchy <type 'unicode'> recepce
<type 'unicode'> psc <type 'unicode'> 28835
<type 'unicode'> mesto <type 'unicode'> Nymburk
<type 'unicode'> geocode_accuracy <type 'str'> Z
<type 'unicode'> adresa2 <type 'unicode'>
<type 'unicode'> adresa1 <type 'unicode'> Sportovní 1801
<type 'unicode'> zem_delka <type 'unicode'> 15.058984
<type 'unicode'> zem_sirka <type 'unicode'> 50.178441
<type 'unicode'> elektrina_za_rok_bez_dph <type 'unicode'> 2356
<type 'unicode'> kontaktni_osoba_jmeno <type 'unicode'> Tomáš
<type 'unicode'> cislo_signys_partnera <type 'unicode'> 34
<type 'unicode'> tel_reseni_poruchy <type 'unicode'> +420325517801
<type 'unicode'> nazev_prodejniho_mista <type 'unicode'> SC Nymburk
<type 'unicode'> dnu_rok_otevreno <type 'unicode'> 360
<type 'unicode'> najem_za_rok_bez_dph <type 'unicode'> 10400

print myQuery:
UPDATE prodejni_mista SET tel_kontaktni_osoby = ('+420734803579'),
kontaktni_osoba_prijmeni = ('Zburník'), nazev_kontakt_mista_poruchy =
('recepce'), psc = ('28835'), mesto = ('Nymburk'), geocode_accuracy =
('Z'), adresa2 = (''), adresa1 = ('Sportovní 1801'), zem_delka =
('15.058984'), zem_sirka = ('50.178441'), elektrina_za_rok_bez_dph =
('2356'), kontaktni_osoba_jmeno = ('Tomáš'), cislo_signys_partnera =
('34'), tel_reseni_poruchy = ('+420325517801'), nazev_prodejniho_mista =
('SC Nymburk'), dnu_rok_otevreno = ('360'), najem_za_rok_bez_dph =
('10400') WHERE id = (19)

print repr(myQuerry)
u"UPDATE prodejni_mista SET tel_kontaktni_osoby = ('+420734803579'),
kontaktni_osoba_prijmeni = ('Zburn\xedk'), nazev_kontakt_mista_poruchy =
('recepce'), psc = ('28835'), mesto = ('Nymburk'), geocode_accuracy =
('Z'), adresa2 = (''), adresa1 = ('Sportovn\xed 1801'), zem_delka =
('15.058984'), zem_sirka = ('50.178441'), elektrina_za_rok_bez_dph =
('2356'), kontaktni_osoba_jmeno = ('Tom\xe1\u0161'), cislo_signys_partnera
= ('34'), tel_reseni_poruchy = ('+420325517801'), nazev_prodejniho_mista =
('SC Nymburk'), dnu_rok_otevreno = ('360'), najem_za_rok_bez_dph =
('10400') WHERE id = (19)"

Can you send me your suggestions please?

Thanks

Petr

------------------------------------------------------------------------------
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.