On Wed, Apr 17, 2013 at 2:59 PM, James Hartley <jjhart...@gmail.com> wrote: > On Wed, Apr 17, 2013 at 6:20 AM, Lele Gaifax <l...@metapensiero.it> wrote: >> >> James Hartley <jjhart...@gmail.com> writes: >> > Is it possible to map Table instances back to classes defined through >> > declarative_base()? >> >> ...I assume you are asking whether you can map a "view" onto a >> >> Python class using the declarative layer. If so, yes, SQLAlchemy does >> not care about how the underlying table is implemented, it will issue >> the same SQL in either cases. >> > > Thanks for your reply. Any hints on how to tie a class inheriting from Base > to a Table? I have been unsuccessful in bridging the two. >
Set __table__ to your Table instance: http://docs.sqlalchemy.org/en/rel_0_8/orm/extensions/declarative.html#using-a-hybrid-approach-with-table Simon -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.