The threadinglocal module is accessible via the sqlobject.util module.
See the source for more information.