I'm using a declarative mapping in combination with reflection, and I'm
providing some custom renaming of column names in the mapped class, as
demonstrated below.
temp_user = self.metadata.tables['user_t']
class MappedUser(Base):
__table__ = temp_user
user_number = temp_user.c.user_id
not sure what you mean by descriptor here. Here's a test. show me how to
reproduce the broken behavior:
from sqlalchemy import *
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
t = Table('t', Base.metadata,
Column('user_id', Integer,
I was using descriptor as best I could to match its meaning as I understood
it in SQLAlchemy
(http://docs.sqlalchemy.org/ru/latest/glossary.html#term-descriptor), but it
may be wrong. Here's how I could somewhat reproduce the error using your code
(by the way, which is more appropriate for
right that won't work. if you want that pattern, use synonym():
http://docs.sqlalchemy.org/en/rel_0_8/orm/mapper_config.html#id2
usually a hybrid is what's used here but if you really want just the alternate
name, synonym will do it.
short code examples inline are just fine.
On May 6,