vantage6.backend.common.base.BaseDatabaseSessionManager#
- class BaseDatabaseSessionManager#
Bases:
object
Class to manage DB sessions.
There are 2 different ways a session can be obtained. Either a session used within a request or a session used elsewhere (e.g. socketIO event, iPython or within the application itself).
In case of the Flask request, the session is stored in the flask global g. Then, it can be accessed in every endpoint.
In all other cases the session is attached to the db module.
- __init__()#
Methods
__init__
()Clear the session.
Check if we are in a flask request.
- static clear_session()#
Clear the session. If we are in a flask request, the session is cleared from the flask global g. Otherwise, the session is removed from the db module.
- Return type:
None
- static in_flask_request()#
Check if we are in a flask request.
- Returns:
True if we are in a flask request, False otherwise
- Return type:
boolean