code: def db(self):
          
  
          # Initialize the database handle from the middleware's copy of
          # it
          if not self._db:
              self._db = self.middleware.db
  
          return self._db
docs: Obtain a handle for the database.  This allows lazy
          initialization of the database handle.