summaryrefslogtreecommitdiff
path: root/examples/versioning
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-09-05 11:28:43 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2010-09-05 11:28:43 -0400
commit7217711f46ed41f5d657f5f1b522a73ad2f307a0 (patch)
treeef3eb10f436e8979931939db30322793cdf3e039 /examples/versioning
parent6e83926657057c97239bef114e640f2b102be02c (diff)
downloadsqlalchemy-7217711f46ed41f5d657f5f1b522a73ad2f307a0.tar.gz
- mapper _get_col_to_prop private method used
by the versioning example is deprecated; now use mapper.get_property_by_column() which will remain the public method for this. - turned TODO in the history example into an assertion with a descriptive reason
Diffstat (limited to 'examples/versioning')
-rw-r--r--examples/versioning/history_meta.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/versioning/history_meta.py b/examples/versioning/history_meta.py
index c2b283f1a..d2d7c1247 100644
--- a/examples/versioning/history_meta.py
+++ b/examples/versioning/history_meta.py
@@ -123,7 +123,7 @@ def create_version(obj, session, deleted = False):
# mapped column. this will allow usage of MapperProperties
# that have a different keyname than that of the mapped column.
try:
- prop = obj_mapper._get_col_to_prop(obj_col)
+ prop = obj_mapper.get_property_by_column(obj_col)
except UnmappedColumnError:
# in the case of single table inheritance, there may be
# columns on the mapped table intended for the subclass only.
@@ -144,7 +144,9 @@ def create_version(obj, session, deleted = False):
elif u:
attr[hist_col.key] = u[0]
else:
- raise Exception("TODO: what makes us arrive here ?")
+ assert False, "Attribute had no previous state. "\
+ "This indicates active_history isn't "\
+ "working as expected."
if not obj_changed and not deleted:
return