take a look at http://docs.sqlalchemy.org/en/rel_0_9/orm/nonstandard_mappings.html#mapping-a-class-against-multiple-tables for an example of declarative mapping to multiple tables.
M3nt0r3 <m3nt...@gmail.com> wrote: > Hi, > i am migrating from classic to declarative and i am stuck on this mapper. > > whit classic mapper it works well. > > > __table__ = Table('table2', params["metadata"], > Column('id', Integer, primary_key=True), > > > __table__ = Table('table1', params["metadata"], > > Column('id',Integer,ForeignKey(schemaprefix+'table2.id',onupdate="CASCADE",ondelete="CASCADE"),primary_key=True), > > > old mapper: > > mapper(TableClass, join(table1, table2), properties={ 'id': [table1.c.id, > table2.c.id], },order_by=table1.c.id) > > > how can i convert to declarative? > thanks > > Francesco M > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sqlalchemy+unsubscr...@googlegroups.com. > To post to this group, send email to sqlalchemy@googlegroups.com. > Visit this group at http://groups.google.com/group/sqlalchemy. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.