Werner, On Aug 7, 12:36 pm, werner <wbru...@free.fr> wrote: > Allen, > > allen.fowler wrote: > > > On Aug 6, 6:54 pm, AF <allen.fow...@yahoo.com> wrote: > > >> Hello all, > > >> Has anyone here used the "sqlamp: Materialized Path for SQLAlchemy" > >> library? > > >> I am wondering: > > >> 1) Does it seem to work well? > > >> 2) Did you use it with Declarative Base, and if so, how did you > >> configure it? > > > Anybody? > > > Specifically, I am wondering about how adapt the sample code at: > > >http://sqlamp.angri.ru/#quickstart > > > ... so that it works with declarative base. > > I haven't used this library and I am no SA expert so take the following > with a grain (or two) of salt. > > I would translate this: > > class Node(object): > mp = sqlamp.MPManager( > node_table, node_table.c.id, node_table.c.parent_id > ) > > To: > class Node(Base): > __table__ = sa.Table(u'node', metadata, > sa.Column(u'id', sa.Integer(), sa.Sequence('gen_sample_id'), > primary_key=True, nullable=False), > sa.Column(u'parent_id', sa.Integer(), sa.ForeignKey(u'node.id')), > ... > ) > > mp = sqlamp.MPManager( > __table__, __table__.c.id, __table__.c.parent_id) > > Werner
Thank you... Though, that does not look at all like typical Declarative Base code I've seen / been using. Why the explicit assignment to __table__? Further, where does the "extension=[Node.mp.mapper_extension]" binding happen? Thank you again, AF --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@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 -~----------~----~----~----~------~----~------~--~---