Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class dbClient():
- //shdjsahdjajshd
- client = dbClient()
- class Example(client.Document):
- //Some stuff
- @property
- def Document(self):
- return HandlerWrapper(self).subclass()
- @property
- def session(self, db=None): #Alias
- return self.Session()
- def Session(self, db=None):
- return SessionHandler(self, db=db) # What ever it is
- async def run2():
- async with client.Session() as s:
- print(await Example.query(number=2, boolean=False, string_ieq="test"))
- class HandlerWrapper:
- def __init__(self, client):
- self.client = client
- def subclass(self):
- wrapper = self
- class HandlerDocument(Handler):
- def _get_wrapper(self):
- return wrapper
- return HandlerDocument
- class Handler:
- def __init__(self, **kwargs):
- pass
- @staticmethod
- def _get_wrapper(self):
- return None
- @staticmethod
- def _find_session():
- print(dir(calframe[2][0]))
- for varss in globals():
- print(varss)
- @staticmethod
- async def query(**kwargs):
- s = Handler._find_session() #I want to get 's' here or type of 'Session'
- return None
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement