Added proxying of __contains__ and __iter__ methods for scoped sessions

This commit is contained in:
Ants Aasma
2007-10-31 12:14:22 +00:00
parent 7ff65cd035
commit b005aa4e60
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -59,6 +59,8 @@ CHANGES
- Fixed a truncation error when re-assigning a subset of a collection
(obj.relation = obj.relation[1:]) [ticket:834]
- Added proxying of __contains__ and __iter__ methods for scoped sessions.
0.4.0
-----
+1 -1
View File
@@ -73,7 +73,7 @@ def instrument(name):
def do(self, *args, **kwargs):
return getattr(self.registry(), name)(*args, **kwargs)
return do
for meth in ('get', 'load', 'close', 'save', 'commit', 'update', 'flush', 'query', 'delete', 'merge', 'clear', 'refresh', 'expire', 'expunge', 'rollback', 'begin', 'begin_nested', 'connection', 'execute', 'scalar', 'get_bind', 'is_modified'):
for meth in ('get', 'load', 'close', 'save', 'commit', 'update', 'flush', 'query', 'delete', 'merge', 'clear', 'refresh', 'expire', 'expunge', 'rollback', 'begin', 'begin_nested', 'connection', 'execute', 'scalar', 'get_bind', 'is_modified', '__contains__', '__iter__'):
setattr(ScopedSession, meth, instrument(meth))
def makeprop(name):