On Oct 27, 2005, at 1:24 AM, [EMAIL PROTECTED] wrote:

The problem is that our default encoding in Dabo is utf8, but the encoding on those test tables is latin-1. Just explicitly set the encoding in the bizobj:

def initProperties(self):
...
self.Encoding = "latin-1"


The above code added to initProperties of biz.Customer.py generated by
AppWizardX using the dabo MySql db produces the following error:

Traceback (most recent call last):
[snip]

File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\biz \dBizobj.py",
 line 1278, in _setEncoding
    self._CurrentCursor.Encoding = val
AttributeError: 'NoneType' object has no attribute 'Encoding'

At the point this is being executed, no queries have yet been run, so self._CurrentCursor has not yet been created. I've just attempted to remedy this by modifying the bizobj code to create a cursor object in this event. This should relieve the error, but looking over the code brings up another problem.

Paul, we store the Encoding setting in the cursor, not in the bizobj. Setting the Encoding property only changes the encoding for the current bizobj, and child bizobjs can have several cursors which represent different parent records. I think it is safe to presume that the encoding will not change from record to record, so it seems that the encoding setting should be kept at the bizobj level and propagated to all its cursors. If this makes sense to you, let me know and I'll make that change.


-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Reply via email to