diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-02-02 19:05:36 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-02-02 19:05:36 -0500 |
| commit | b85f0b5681272dc0976bbb760fdbb243aa7ce5a4 (patch) | |
| tree | b71b00f7b4a8b01d97a660e01caabc87ef5c294e /examples | |
| parent | 1b8a495767866f975a12e516dee98eaf7f2269c0 (diff) | |
| download | sqlalchemy-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.py | 3 |
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 |
