Dear Oleg!

Oleg Broytmann wrote:
On Thu, Sep 28, 2006 at 02:10:24AM +0200, Mathias Winkler wrote:
  
            NewsItem._connection.query("SET NAMES utf8") # hope never dies
            item=NewsItem.get(id)
            log.debug("writing headline as: %s" % repr(headline))
            item.headline=headline
            log.debug("written headline is: %s" % 
repr(item.headline))          
-->

produces a good-looking debug output like that:
    

   The last debug logging logs item.headline from the memory. It would be
more interesting to draw the value from the database. To do that clear the
cache:

NewsItem._connection.query("SET NAMES utf8") # hope never dies
item=NewsItem.get(id)
log.debug("writing headline as: %s" % repr(headline))
item.headline=headline
NewsItem._connection.clear()
item=NewsItem.get(id)
log.debug("written headline is: %s" % repr(item.headline))

Oleg.
  
I guess you meant ._connection.cache.clear()? I did that, heres the output of cherrypy:

2006-09-28 10:46:35,361 bogi.controllers DEBUG writing headline as: u'ooo\xd6\xd6\xd6ooo'
 1/Query   :  UPDATE news_item SET headline = ('oooÖÖÖooo') WHERE id = (27)
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1860-py2.4.egg/sqlobject/mysql/mysqlconnection.py:75: Warning: Data truncated for column 'headline' at row 1
  return cursor.execute(myquery)
 1/QueryOne:  SELECT date, headline, body FROM news_item WHERE id = (27)
2006-09-28 10:46:35,380 bogi.controllers DEBUG written headline is: u'ooo???ooo'


so it it all comes down to that Data truncated warning, I guess?



Mathias