def _register(self): TM._register(self) # XXX Make sure we are called before the # persistent ExtFile object is destroyed. t = transaction.get() if hasattr(t, '_resources'): r = t._resources.pop() t._resources.insert(0, r)
def tr(): t = transaction.get() if hasattr(t, '_objects'): return t._objects # ZODB <= 3.2 elif hasattr(t, '_resources'): return t._resources # ZODB >= 3.4