diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-12-21 11:44:46 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-12-21 11:44:46 -0500 |
| commit | c2e2d3c4640d846dd4bc9e45c04c22523cebb750 (patch) | |
| tree | 9f6e973d5b479f9c50254d9aec8a3f2215621afe /lib/sqlalchemy | |
| parent | 29e5a23aee38e4d832b6952a9009bb4a8ada4df8 (diff) | |
| download | sqlalchemy-c2e2d3c4640d846dd4bc9e45c04c22523cebb750.tar.gz | |
tiny inlinings
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/orm/mapper.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py index ca23edf3c..9bb84e86c 100644 --- a/lib/sqlalchemy/orm/mapper.py +++ b/lib/sqlalchemy/orm/mapper.py @@ -2100,8 +2100,6 @@ class Mapper(object): version_id_col = adapter.columns[version_id_col] identity_class = self._identity_class - def identity_key(row): - return identity_class, tuple([row[column] for column in pk_cols]) new_populators = [] existing_populators = [] @@ -2119,18 +2117,19 @@ class Mapper(object): new_populators, existing_populators ) - + if isnew: populators = new_populators else: populators = existing_populators if only_load_props: - populators = [p for p in populators - if p[0] in only_load_props] - - for key, populator in populators: - populator(state, dict_, row) + for key, populator in populators: + if key in only_load_props: + populator(state, dict_, row) + else: + for key, populator in populators: + populator(state, dict_, row) session_identity_map = context.session.identity_map @@ -2170,7 +2169,7 @@ class Mapper(object): # occur within a flush() identitykey = self._identity_key_from_state(refresh_state) else: - identitykey = identity_key(row) + identitykey = identity_class, tuple([row[column] for column in pk_cols]) instance = session_identity_map.get(identitykey) if instance is not None: |
