aacanakin / glim

a modern python framework for the web

Home Page:http://glim.readme.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add feature for reusable route filters

aacanakin opened this issue · comments

When defining a route with filter, it is needed to rewrite the controller mapping each time like the following;

# routes.py
urls = {
    '/api': {
        '/post': [
            'ApiController.check_auth', # runs before me
            'UserController.me'
        ],
        '/profile': [
            'ApiController.check_auth',
            'ProfileController.get'
        ]
    }
}

In this example, check_auth is should be defined once.

filters are disabled currently, decorator filters will be introduced