Exemple #1
0
 def __init__(self, *args, **kwargs):
     tornado.web.Application.__init__(self, *args, **kwargs)
     self.Session, self.engine = model.create_initialize_db(options.db_url)
     session = self.Session()
     try:
         page = model.Page.query(session).first()
         if page is None:
             session.add(model.Page(title="Index", content="Sample Page."))
             session.commit()
             time.sleep(0.2)
             model.Publication.publish(session)
             session.commit()
     finally:
         session.close()
Exemple #2
0
 def __init__(self, *args, **kwargs):
     tornado.web.Application.__init__(self, *args, **kwargs)
     self.Session, self.engine = model.create_initialize_db(options.db_url)
     session = self.Session()
     try:
         page = model.Page.query(session).first()
         if page is None:
             session.add(model.Page(title="Index",content="Sample Page."))
             session.commit()
             time.sleep(0.2)
             model.Publication.publish(session)
             session.commit()
     finally:
         session.close()
Exemple #3
0
 def setUp(self):
     self._Session, self._engine = create_initialize_db("sqlite://", echo=False)
     self.session = self._Session()
Exemple #4
0
 def setUp(self):
     self._Session, self._engine = create_initialize_db("sqlite://",
                                                        echo=False)
     self.session = self._Session()