Commit 7b6ef5fe authored by Marco Mariani's avatar Marco Mariani

jsonify decorator

parent 5b9ff180
# -*- coding: utf-8 -*-
# vim: set et sts=2:
import json
from flask import Response
def as_json(f):
def inner(*args, **kwargs):
return Response(json.dumps(f(*args, **kwargs)), mimetype='application/json')
return inner
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment