예제 #1
0
파일: base.py 프로젝트: johnlunney/porick
 def __call__(self, environ, start_response):
     """Invoke the Controller"""
     # WSGIController.__call__ dispatches to the Controller method
     # the request is routed to. This routing information is
     # available in environ['pylons.routes_dict']
     try:
         return WSGIController.__call__(self, environ, start_response)
     finally:
         db.remove()
예제 #2
0
파일: base.py 프로젝트: johnlunney/porick
 def __call__(self, environ, start_response):
     """Invoke the Controller"""
     # WSGIController.__call__ dispatches to the Controller method
     # the request is routed to. This routing information is
     # available in environ['pylons.routes_dict']
     try:
         return WSGIController.__call__(self, environ, start_response)
     finally:
         db.remove()
예제 #3
0
파일: base.py 프로젝트: netsoc/porick
    def _process_auth_cookies(self):
        c.logged_in = False
        c.user = None

        auth = request.cookies.get('auth')
        username = request.cookies.get('username')
        level = request.cookies.get('level')
        if auth:
            if hashlib.md5('%s:%s:%s' % (config['COOKIE_SECRET'], username, level)).hexdigest() == auth:
                c.logged_in = True
                c.user = db.query(User).filter(User.username == username).first()
예제 #4
0
파일: base.py 프로젝트: johnlunney/porick
    def _process_auth_cookies(self):
        c.logged_in = False
        c.user = None

        auth = request.cookies.get('auth')
        username = request.cookies.get('username')
        level = request.cookies.get('level')
        if auth:
            if hashlib.md5('%s:%s:%s' % (config['COOKIE_SECRET'], username,
                                         level)).hexdigest() == auth:
                c.user = db.query(User).filter(
                    User.username == username).first()
                if c.user:
                    c.logged_in = True
예제 #5
0
파일: __init__.py 프로젝트: netsoc/porick
def init_model(engine):
    """Call me before using any of the tables or classes in the model"""
    db.configure(bind=engine)
예제 #6
0
def init_model(engine):
    """Call me before using any of the tables or classes in the model"""
    db.configure(bind=engine)