예제 #1
0
# Copyright (c) 2010 Pedro Matiello <*****@*****.**>

"""
Routing configuration.
"""

import tornado.web
from handlers.entity import entity_handler, entities_handler
from models.entity import entity_repository
from util.database import session_factory

routes = [
    (r"/", entities_handler, {'repository': entity_repository(session_factory())}),
    (r"/([0-9]+)/", entity_handler, {'repository': entity_repository(session_factory())})
]

application = tornado.web.Application(routes,
                                      template_path='view/')
예제 #2
0
# Copyright (c) 2010 Pedro Matiello <*****@*****.**>
"""
Routing configuration.
"""

import tornado.web
from handlers.entity import entity_handler, entities_handler
from models.entity import entity_repository
from util.database import session_factory

routes = [(r"/", entities_handler, {
    'repository': entity_repository(session_factory())
}),
          (r"/([0-9]+)/", entity_handler, {
              'repository': entity_repository(session_factory())
          })]

application = tornado.web.Application(routes, template_path='view/')
예제 #3
0
 def setup(self):
     self.session = mock()
     self.repository = entity_repository(self.session)
     self.msg = entity("Field1 data", "Field1 data")