Re: [Sqlalchemy-tickets] [sqlalchemy] #2856: Oracle error with reflect on table with cyrillic colum
Brought to you by:
zzzeek
|
From: sqlalchemy <mi...@zz...> - 2013-10-31 17:49:33
|
#2856: Oracle error with reflect on table with cyrillic column names in
-------------------------+-------------------------------------------------
Reporter: teddy | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone:
Component: | Severity: no triage selected yet
declarative | Keywords: oracle, cyrillic, declarative,
Resolution: | reflexion
Progress State: |
awaiting triage |
-------------------------+-------------------------------------------------
Comment (by teddy):
Another little addition, sorry for my memory =)
If we declare mapped class a bit more explicitly:
{{{#!python
class CyrTest(Base):
__table__ = Table("cyr_test", Base.metadata,
Column(u'ИД', Integer, primary_key=True, key='id'),
Column(u'ПОЛЕ1', String, key='field1'),
Column(u'ЕЩЕПОЛЕ', String, key='field2'),
oracle_resolve_synonyms=True,
autoload=True
)
}}}
It will reflect on table successfully. The problem in keys, of course.
I dont't know how to resolve this situation, but i see 2 ways:
At first, we can just use colimn names as is, so we can write something
like {{{CyrTest.Поле1}}}.
At second, we can trasliterate names to latin, and use something like
{{{CyrTest.Pole1}}}.
Transliteration libraries is present for Python, for example
https://pypi.python.org/pypi/trans, which i use in my projects.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2856#comment:2>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|