summaryrefslogtreecommitdiff
path: root/examples/vertical/vertical.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-11-03 01:17:28 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-11-03 01:17:28 +0000
commit695f65db853a7b74a1ce2da75d8e3c55bbafae81 (patch)
treedd66a8f126fa1c44cfb7349c319168ab6c3b0a0f /examples/vertical/vertical.py
parent14845494113b5327b2ed7f8ed13aed9bc9ce27b2 (diff)
downloadsqlalchemy-695f65db853a7b74a1ce2da75d8e3c55bbafae81.tar.gz
- added an assertion within the "cascade" step of ORM relationships to check
that the class of object attached to a parent object is appropriate (i.e. if A.items stores B objects, raise an error if a C is appended to A.items) - new extension sqlalchemy.ext.associationproxy, provides transparent "association object" mappings. new example examples/association/proxied_association.py illustrates. - some example cleanup
Diffstat (limited to 'examples/vertical/vertical.py')
-rw-r--r--examples/vertical/vertical.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/examples/vertical/vertical.py b/examples/vertical/vertical.py
index 4f0f5a15c..a6ee17428 100644
--- a/examples/vertical/vertical.py
+++ b/examples/vertical/vertical.py
@@ -1,11 +1,10 @@
-from sqlalchemy import *
-import datetime
-import sys
-
"""this example illustrates a "vertical table". an object is stored with individual attributes
represented in distinct database rows. This allows objects to be created with dynamically changing
fields that are all persisted in a normalized fashion."""
-
+
+from sqlalchemy import *
+import datetime
+
e = BoundMetaData('sqlite://', echo=True)
# this table represents Entity objects. each Entity gets a row in this table,