Tornado - Python global variable
问题 I'm trying to use Tornado with SqlAlchemy, I need to pass the current user from RequestHandler (tornado) to models (SqlAlchemy) in the insert or update action. But I don't want to pass the value directly to the model, example: #### RequestHandler POST method... user = Session.query(User).get(1) user.name = "bla, bla, bla..." user.updated_by = self.current_user # don't use... session.commit() I'm using a global variable, in a __ init__.py file, and set the current user value in the