diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-07-28 17:05:50 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-07-28 17:05:50 -0400 |
commit | 22ba1c43b792953ae6f791512d276739c8c09eae (patch) | |
tree | bdf9f639b01426a8a2e1c8c61d35533026dd4265 /lib/sqlalchemy/orm/dynamic.py | |
parent | 27913554a85c308d81e6c018669d0246ceecc639 (diff) | |
download | sqlalchemy-22ba1c43b792953ae6f791512d276739c8c09eae.tar.gz |
-whitespace bonanza, contd
Diffstat (limited to 'lib/sqlalchemy/orm/dynamic.py')
-rw-r--r-- | lib/sqlalchemy/orm/dynamic.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/sqlalchemy/orm/dynamic.py b/lib/sqlalchemy/orm/dynamic.py index c2f4aff02..d2cb0ab05 100644 --- a/lib/sqlalchemy/orm/dynamic.py +++ b/lib/sqlalchemy/orm/dynamic.py @@ -14,7 +14,7 @@ basic add/delete mutation. from .. import log, util from ..sql import operators from . import ( - attributes, object_session, util as orm_util, strategies, + attributes, object_session, util as orm_util, strategies, object_mapper, exc as orm_exc, collections ) from .query import Query @@ -60,7 +60,7 @@ class DynamicAttributeImpl(attributes.AttributeImpl): else: return self.query_class(self, state) - def get_collection(self, state, dict_, user_data=None, + def get_collection(self, state, dict_, user_data=None, passive=attributes.PASSIVE_NO_INITIALIZE): if not passive & attributes.SQL_OK: return self._get_collection_history(state, @@ -94,7 +94,7 @@ class DynamicAttributeImpl(attributes.AttributeImpl): if self.key not in state.committed_state: state.committed_state[self.key] = CollectionHistory(self, state) - state._modified_event(dict_, + state._modified_event(dict_, self, attributes.NEVER_SET) @@ -104,7 +104,7 @@ class DynamicAttributeImpl(attributes.AttributeImpl): return state.committed_state[self.key] def set(self, state, dict_, value, initiator, - passive=attributes.PASSIVE_OFF, + passive=attributes.PASSIVE_OFF, check_old=None, pop=False): if initiator and initiator.parent_token is self.parent_token: return @@ -141,8 +141,8 @@ class DynamicAttributeImpl(attributes.AttributeImpl): def get_all_pending(self, state, dict_): c = self._get_collection_history(state, attributes.PASSIVE_NO_INITIALIZE) return [ - (attributes.instance_state(x), x) - for x in + (attributes.instance_state(x), x) + for x in c.added_items + c.unchanged_items + c.deleted_items ] @@ -159,12 +159,12 @@ class DynamicAttributeImpl(attributes.AttributeImpl): else: return c - def append(self, state, dict_, value, initiator, + def append(self, state, dict_, value, initiator, passive=attributes.PASSIVE_OFF): if initiator is not self: self.fire_append_event(state, dict_, value, initiator) - def remove(self, state, dict_, value, initiator, + def remove(self, state, dict_, value, initiator, passive=attributes.PASSIVE_OFF): if initiator is not self: self.fire_remove_event(state, dict_, value, initiator) @@ -203,9 +203,9 @@ class AppenderMixin(object): mapper = object_mapper(instance) prop = mapper._props[self.attr.key] self._criterion = prop.compare( - operators.eq, - instance, - value_is_parent=True, + operators.eq, + instance, + value_is_parent=True, alias_secondary=False) if self.attr.order_by: @@ -279,12 +279,12 @@ class AppenderMixin(object): def append(self, item): self.attr.append( - attributes.instance_state(self.instance), + attributes.instance_state(self.instance), attributes.instance_dict(self.instance), item, None) def remove(self, item): self.attr.remove( - attributes.instance_state(self.instance), + attributes.instance_state(self.instance), attributes.instance_dict(self.instance), item, None) |