On Wed, Apr 17, 2013 at 2:59 PM, Michael Bayer <mike...@zzzcomputing.com>wrote:

> James Hartley <jjhart...@gmail.com> writes:
>> > Is it possible to map Table instances back to classes defined through
>> > declarative_base()?
>>
> the typical form is:
>
> Base = declarative_base()
>
> some_table = Table('some_table', Base.metadata, Column('id', Integer,
> primary_key=True))
>
> class SomeClass(Base):
>    __table__ = some_table
>

Thanks all for the responses.

The Wiki recipe for views:

http://www.sqlalchemy.org/trac/wiki/UsageRecipes/Views

...creates & drops the defined view on-the-fly.  This raises two
questions.  Is there a way to allow the view created in Python code to
persist?  Likewise, is there a way to take advantage of an existing view
defined at the database level?  An obvious workaround is to create a
duplicate view with a different name, but I'm curious as to whether the two
can be merged.

Thanks again for the insight shared.

-- 
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.


Reply via email to