summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/build/changelog/changelog_09.rst7
-rw-r--r--examples/versioned_history/history_meta.py3
2 files changed, 9 insertions, 1 deletions
diff --git a/doc/build/changelog/changelog_09.rst b/doc/build/changelog/changelog_09.rst
index 992ace2ea..a043d61c3 100644
--- a/doc/build/changelog/changelog_09.rst
+++ b/doc/build/changelog/changelog_09.rst
@@ -15,6 +15,13 @@
:version: 0.9.2
.. change::
+ :tags: bug, examples
+
+ 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.
+
+ .. change::
:tags: feature, sql
Added :paramref:`.MetaData.reflect.**dialect_kwargs`
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