예제 #1
0
 def save(self):
     session  = get_session()
     try:
         session.add(self)
         session.commit()
     except IntegrityError:
         session.rollback()
예제 #2
0
 def save(self):
     yield from asyncio.sleep(1.0)
     session = get_session()
     try:
         session.add(self)
         session.commit()
     except IntegrityError:
         session.rollback()
예제 #3
0
 def get(cls, search_string):
     session  = get_session()
     return session.query(Page).\
         filter("pages.content @@ to_tsquery(:search_string)").\
         params(search_string=search_string).all()