mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-05-19 15:12:04 -04:00
Added proxying of __contains__ and __iter__ methods for scoped sessions
This commit is contained in:
@@ -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
|
||||
-----
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user