diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-06-21 16:08:04 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-06-21 16:08:04 +0000 |
| commit | 060c3ce33c02c2bcd78b54e05da8b9196a296b62 (patch) | |
| tree | 76d2a479536efcd709bffa6c4264b66e2fbba625 /lib/sqlalchemy/orm/attributes.py | |
| parent | 8af372585a7da02507036219118d17b2b58e2aad (diff) | |
| download | sqlalchemy-060c3ce33c02c2bcd78b54e05da8b9196a296b62.tar.gz | |
- In addition to expired attributes, deferred attributes
also load if their data is present in the result set
[ticket:870]
Diffstat (limited to 'lib/sqlalchemy/orm/attributes.py')
| -rw-r--r-- | lib/sqlalchemy/orm/attributes.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py index 2dbef2497..c6c1860ea 100644 --- a/lib/sqlalchemy/orm/attributes.py +++ b/lib/sqlalchemy/orm/attributes.py @@ -883,6 +883,19 @@ class InstanceState(object): or (key in self.manager.mutable_attributes and not self.manager[key].impl.check_mutable_modified(self)) ]) unmodified = property(unmodified) + + def unloaded(self): + """a set of keys which do not have a loaded value. + + This includes expired attributes and any other attribute that + was never populated or modified. + + """ + return util.Set([ + key for key in self.manager.keys() if + key not in self.committed_state and key not in self.dict + ]) + unloaded = property(unloaded) def expire_attributes(self, attribute_names): self.expired_attributes = util.Set(self.expired_attributes) |
