Пример #1
0
    def __init__(self, connection=None, engine=None, session=None, user_model=User, role_model=Role):  # noqa: D107
        super(Manager, self).__init__(connection=connection, engine=engine, session=session)

        Base.metadata.bind = self.engine
        Base.query = self.session.query_property()

        SQLAlchemyUserDatastore.__init__(self, db=self, user_model=user_model, role_model=role_model)
Пример #2
0
 def __init__(self, db, user_model, role_model):
     # print("******************* SQLAlchemyUserDatastoreCACHED INIT  ********************* ")
     SQLAlchemyUserDatastore.__init__(self, db, user_model, role_model)
     self.cache_users = werkzeug.contrib.cache.SimpleCache(
         threshold=500, default_timeout=300)  # 5 minutes
     self.lock = threading.Lock(
     )  # on compense que simple cache n'est pas thread safe
Пример #3
0
 def __init__(self, db, user_moel):
     SQLAlchemyUserDatastore.__init__(self, db, user_moel, None)
 def __init__(self, db, user_model, role_model):
     # You can query directly on the model with sqlsoup
     user_model.query = user_model
     role_model.query = role_model
     SQLAlchemyUserDatastore.__init__(self, db, user_model, role_model)