我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用werkzeug.LocalProxy()。
def schemas(self): from werkzeug import LocalProxy def get_schemas(): if not getattr(self, '_schemas', None): self.connect() try: from .schemas import Schemas self._schemas = Schemas(self._sqlalchemy_metadata) except ImportError: logger.warning('cannot import Schemas, perhaps sqlalchemy is not up to date') return self._schemas return LocalProxy(get_schemas)