# HG changeset patch # User Tero Marttila # Date 1422574131 -7200 # Node ID e77b7c324a32ab2f8433098db3ddf6d5f2ab14cd # Parent 05707929ff6f013487c87c54dea37ed93299e56f qmsk.web.json diff -r 05707929ff6f -r e77b7c324a32 qmsk/web/json.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qmsk/web/json.py Fri Jan 30 01:28:51 2015 +0200 @@ -0,0 +1,13 @@ +import json + +class JSONMixin: + MIMETYPE = 'application/json' + + def render_json(self, **parms): + raise NotImplementedError() + + def render_response(self, **params): + data = self.render_json(**params) + + return json.dumps(data) +