summaryrefslogtreecommitdiff
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
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.
-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