summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-02-02 19:05:36 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2014-02-02 19:05:36 -0500
commitb85f0b5681272dc0976bbb760fdbb243aa7ce5a4 (patch)
treeb71b00f7b4a8b01d97a660e01caabc87ef5c294e /examples
parent1b8a495767866f975a12e516dee98eaf7f2269c0 (diff)
downloadsqlalchemy-b85f0b5681272dc0976bbb760fdbb243aa7ce5a4.tar.gz
- Added a tweak to the "history_meta" example where the check for
"history" on a relationship-bound attribute will now no longer emit any SQL if the relationship is unloaded.
Diffstat (limited to 'examples')
-rw-r--r--examples/versioned_history/history_meta.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/versioned_history/history_meta.py b/examples/versioned_history/history_meta.py
index 8cb523434..04cb4e1aa 100644
--- a/examples/versioned_history/history_meta.py
+++ b/examples/versioned_history/history_meta.py
@@ -160,7 +160,8 @@ def create_version(obj, session, deleted = False):
# check those too
for prop in obj_mapper.iterate_properties:
if isinstance(prop, RelationshipProperty) and \
- attributes.get_history(obj, prop.key).has_changes():
+ attributes.get_history(obj, prop.key,
+ passive=attributes.PASSIVE_NO_INITIALIZE).has_changes():
for p in prop.local_columns:
if p.foreign_keys:
obj_changed = True