def _search(cls, **kwargs): session = SessionHeap() query = session.query(cls).filter_by(**kwargs) SessionHeap.remove() return query
def query(cls, **kwargs): session = SessionHeap() query = session.query(cls) SessionHeap.remove() return query
def create(cls, **kwargs): session = SessionHeap() session.add(cls(**kwargs)) session.commit() session.close() SessionHeap.remove()