From: Mike Bayer Date: Mon, 3 Feb 2014 00:05:36 +0000 (-0500) Subject: - Added a tweak to the "history_meta" example where the check for X-Git-Tag: rel_0_9_2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b85f0b5681272dc0976bbb760fdbb243aa7ce5a4;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - 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. --- diff --git a/doc/build/changelog/changelog_09.rst b/doc/build/changelog/changelog_09.rst index 992ace2ea2..a043d61c34 100644 --- a/doc/build/changelog/changelog_09.rst +++ b/doc/build/changelog/changelog_09.rst @@ -14,6 +14,13 @@ .. changelog:: :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 diff --git a/examples/versioned_history/history_meta.py b/examples/versioned_history/history_meta.py index 8cb5234343..04cb4e1aab 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