diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-08-30 20:10:03 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-08-30 20:10:03 -0400 |
commit | 3d439e180103e3b1aab14094912bb566da2d7f5d (patch) | |
tree | 0dc336ae715363f2405187097643c7b21bed8f8d /examples/inheritance/polymorph.py | |
parent | 092fbb40eb72d08a9eb433a6ac182723af774201 (diff) | |
download | sqlalchemy-3d439e180103e3b1aab14094912bb566da2d7f5d.tar.gz |
- a large hill to climb. Added declarative examples to all the
"basic relationship" examples, cleaned up the examples and added
some more explicitness. Also renamed "treenodes" to "nodes" and
added self-referential declarative example.
- Added info/examples on how to join tables directly when querying with
joined table inheritance.
- Starting to talk about hybrids in the main mapper docs some more.
introducoed the idea that synonyms are on their way out.
- SQL expressions as mapped attributes also gets better verbiage,
alternative approaches to them, including hybrids.
- modernized the hybrid example.
- object_session() as a standalone function wasn't documented ?!
Diffstat (limited to 'examples/inheritance/polymorph.py')
-rw-r--r-- | examples/inheritance/polymorph.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/inheritance/polymorph.py b/examples/inheritance/polymorph.py index 872318060..87c2de10e 100644 --- a/examples/inheritance/polymorph.py +++ b/examples/inheritance/polymorph.py @@ -112,6 +112,14 @@ c = session.query(Company).get(1) for e in c.employees: print e +# illustrate querying using direct table access: + +print session.query(Engineer.engineer_name).\ + select_from(engineers).\ + filter(Engineer.primary_language=='python').\ + all() + + session.delete(c) session.commit() |