aboutsummaryrefslogtreecommitdiff
path: root/src/web/views/api/v3/article.py
blob: ebd15d248dcbe21e3341def662f8a4896dd97f33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from web import models
from bootstrap import application, manager
from web.views.api.v3.common import url_prefix, auth_func
from web.views.api.v3.common import get_single_preprocessor, get_many_preprocessor


blueprint_article = manager.create_api_blueprint(models.Article,
        url_prefix=url_prefix,
        methods=['GET', 'POST', 'PUT', 'DELETE'],
        preprocessors=dict(GET_SINGLE=[auth_func, get_single_preprocessor],
                           GET_MANY=[auth_func, get_many_preprocessor],
                           PUT_SINGLE=[auth_func],
                           POST=[auth_func],
                           DELETE=[auth_func]))
application.register_blueprint(blueprint_article)
bgstack15