Example #1
0
 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()
Example #2
0
 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()
Example #3
0
    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()
Example #4
0
    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
Example #5
0
def init_model(engine):
    """Call me before using any of the tables or classes in the model"""
    db.configure(bind=engine)
Example #6
0
def init_model(engine):
    """Call me before using any of the tables or classes in the model"""
    db.configure(bind=engine)