On 9/25/15 9:00 AM, Mike Bayer wrote:
On 9/25/15 3:13 AM, Chris Withers wrote:
Hi All,
Is this still the best way to hand views, or are there later and
greater things in 1.0+?
https://bitbucket.org/zzzeek/sqlalchemy/wiki/UsageRecipes/Views
How would I make a view behave like a normal declarative class
(column attributes, etc), but while still having it create itself as
part of create_all?
There's probably some semi-elaborate way to do this, though it would
take some tinkering.
I have an interest in showing you some of this tinkering as I really
recall having done this for someone recently and I'm wondering why I
didn't add to the wiki, but I've really had an over-the-top level of
time shortage in the past few weeks, so feel free to harass me on IRC
during the workday.
Any Table can just have as its name the name of your view, and you'd
link it to declarative with __table__. That won't get you the
create_all() part and you might want this Table to be on a separate
MetaData so that it isn't included in it, but it would get you started.
cheers,
Chris
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.