diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-12-21 16:20:46 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-12-21 16:20:46 +0000 |
| commit | 90c3944dacad5c1ebb023d6fa2abb95d8ac0dda4 (patch) | |
| tree | 5bcf9d84bc658eacd0471d5bada3f417bafbbc55 /lib/sqlalchemy | |
| parent | b9dd765d921a01efce811c689a0ec06b90ccbc5d (diff) | |
| download | sqlalchemy-90c3944dacad5c1ebb023d6fa2abb95d8ac0dda4.tar.gz | |
- disabled the "populate expired/deferred attributes as we come across them" functionality in mapper._instance(), as its not completed, doesn't properly handle mutable scalar attributes, and has poor test coverage
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/orm/mapper.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py index f61b70bc3..6d8d88cba 100644 --- a/lib/sqlalchemy/orm/mapper.py +++ b/lib/sqlalchemy/orm/mapper.py @@ -1366,12 +1366,12 @@ class Mapper(object): if 'populate_instance' not in extension.methods or extension.populate_instance(self, context, row, instance, only_load_props=only_load_props, instancekey=identitykey, isnew=isnew) is EXT_CONTINUE: self.populate_instance(context, instance, row, only_load_props=only_load_props, instancekey=identitykey, isnew=isnew) - elif getattr(state, 'expired_attributes', None): - # TODO: dont base this off of 'expired_attrbutes' - base it off of unloaded attrs, possibly - # based on the state.callables collection. - attrs = state.expired_attributes.intersection(state.unmodified) - if 'populate_instance' not in extension.methods or extension.populate_instance(self, context, row, instance, only_load_props=attrs, instancekey=identitykey, isnew=isnew) is EXT_CONTINUE: - self.populate_instance(context, instance, row, only_load_props=attrs, instancekey=identitykey, isnew=isnew) +# NOTYET: populate attributes on non-loading instances which have been expired, deferred, etc. +# elif getattr(state, 'expired_attributes', None): # TODO: base off total set of unloaded attributes, not just exp +# attrs = state.expired_attributes.intersection(state.unmodified) +# if 'populate_instance' not in extension.methods or extension.populate_instance(self, context, row, instance, only_load_props=attrs, instancekey=identitykey, isnew=isnew) is EXT_CONTINUE: +# self.populate_instance(context, instance, row, only_load_props=attrs, instancekey=identitykey, isnew=isnew) +# context.partials.add((state, attrs)) <-- allow query.instances to commit the subset of attrs if result is not None and ('append_result' not in extension.methods or extension.append_result(self, context, row, instance, result, instancekey=identitykey, isnew=isnew) is EXT_CONTINUE): result.append(instance) @@ -1412,8 +1412,6 @@ class Mapper(object): existing_populators = [] post_processors = [] for prop in self.__props.values(): - if only_load_props and prop.key not in only_load_props: - continue (newpop, existingpop, post_proc) = selectcontext.exec_with_path(self, prop.key, prop.create_row_processor, selectcontext, self, row) if newpop is not None: new_populators.append((prop.key, newpop)) |
