niming_igapi/utils/shareclass.py
2024-11-21 18:14:01 +00:00

19 lines
442 B
Python

from sqlalchemy.orm import sessionmaker
class Shared:
_client = None # For instagram
_engine = None # For engine
@classmethod
def __init__(cls, cl, eng):
cls._client = cl
cls._engine = eng
@classmethod
def ig_get_client(cls):
return cls._client
@classmethod
def db_get_session(cls):
Session = sessionmaker(bind=cls._engine)
return Session()