On Sep 10, 2010, at 9:35 AM, Andrey Semyonov wrote: > On 10 сен, 17:15, "King Simon-NFHD78" <simon.k...@motorola.com> wrote: >> Hi Andrey, >> >> See the section in the docs 'Attribute Names for Mapped Columns': >> >> http://www.sqlalchemy.org/docs/orm/mapper_config.html#attribute-names-fo >> r-mapped-columns >> >> Hope that helps, >> >> Simon > > Well, this leads to the only way to map in my case named > 'Declarative'. Because it would fail on > > mapper(Class, table, properties = { '_from': table.c.from }) > > Could non-declarative way for mapping python's reserved keywords as > column names be scheduled as a bug or enhancement request ?
Option 1: mapper(C, t1, properties={'from_':t1.c['from']}) Option 2: t1 = Table('sometable', metadata, Column('from', Integer, key='from_')) t1.c.from_ these techniques are documented at: http://www.sqlalchemy.org/docs/core/schema.html#accessing-tables-and-columns http://www.sqlalchemy.org/docs/core/schema.html#sqlalchemy.schema.Column > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To post to this group, send email to sqlalch...@googlegroups.com. > To unsubscribe from this group, send email to > sqlalchemy+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sqlalchemy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.