Dear sqlobject-discuss,

  i have the following class definitions

  class BaseObj(sqlobject.SQLObject):
        _connection = conn

        class sqlmeta:
                lazyUpdate=1
                
  class BaseObjColName(BaseObj):
        code = sqlobject.UnicodeCol(length=20, unique=1, notNone=1, 
alternateID=1)
        name = sqlobject.UnicodeCol(length=100, notNone=1)
        
        def _set_code(self, val):
                val = val.upper()
                self._SO_set_code(val)

  class Workpackage(BaseObjColName):
        status = sqlobject.UnicodeCol(length=8, default='--------')
        
        parent = sqlobject.ForeignKey("Workpackage", default=None)
        children = sqlobject.MultipleJoin("Workpackage", 
joinColumn="parent_id", orderBy='code')
  

  inserting a workpackage record into postgresql is working

  but when i try Workpackage.byCode(XXXXX) it fails
  XXXX is a unicode string

  i get the following exception:
"c:\python24\lib\site-packages\SQLObject-0.7.0-py2.4.egg\sqlobject\dbconnection.py",
 line 295, in _executeRetry
    return cursor.execute(query)
TypeError: argument 1 must be str, not unicode

  please help me how can i overcome this problem.
  
-- 
Best regards,
 Ivan Horvath
 Chief Programmer

Anyone who has never made a mistake has never tried anything new.

/Albert Einstein/



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to