Mercurial > kraina_muminkow
comparison frontend/mfrontend/views/api.py @ 11:69ecfe51d585
Dodałem prosty prototyp API
author | Michał Rudowicz <michal.rudowicz@fl9.eu> |
---|---|
date | Mon, 07 Mar 2011 11:04:11 +0100 |
parents | |
children | 79cf8ca2a0e5 |
comparison
equal
deleted
inserted
replaced
10:58a993029d9f | 11:69ecfe51d585 |
---|---|
1 #!/usr/bin/python | |
2 # -*- coding: utf-8 -*- | |
3 | |
4 from flask import jsonify, Module | |
5 from mfrontend import db, utils, exceptions, decorators | |
6 api = Module(__name__) | |
7 | |
8 @api.route('/getjob/') | |
9 @decorators.login_required | |
10 def get_jobs(): | |
11 return jsonify(jobs = db.get_jobs(None, None, None)) | |
12 | |
13 @api.route('/getjob/<int:jobid>/') | |
14 @decorators.login_required | |
15 def get_job(jobid): | |
16 """ Zwraca w formacie JSON informacje o podanym zadaniu. | |
17 Uwaga: użytkownik musi być zalogowany, aby móc pobrać | |
18 informację o zadaniu. | |
19 @param jobid Identyfikator żądanego zadania. | |
20 @return Informacje o zadaniu w formacie JSON. | |
21 """ | |
22 pass #TODO! |