On Apr 23, 2008, at 3:50 AM, Saibot wrote:
>
> mapper.py", line 669, in _compile_property
> setattr(self.class_, key, Mapper._CompileOnAttr(self.class_, key))
> File "c:\python25\lib\site-packages\sqlalchemy-0.4.4-py2.5.egg
> \sqlalchemy\orm\
> mapper.py", line 539, in __init__
> self.existing_prop = getattr(class_, key, None)
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xdf' in
> position 6:
> ordinal not in range(128)
>
>
> Is there a way to tell orm.mapper() to encode the columnnames into
> iso-8859-1 rather than ascii?
>
this error is specifically your mapper() attempting to assign a class-
bound descriptor to your class using a key name with non ASCII
characters in it. Python doesn't allow this, so you have to assign
"key" values to your columns, either like this, at the Table level:
Table('foo', metadata,
Column("someunicodename", Integer, key="someasciiname"),
autoload=True
)
or like this, at the mapper() level:
mapper(MyClass, mytable, properties={
"someasciiname" : mytable.c['someunicodename']
})
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---