File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 20
20
21
21
import naucse_render
22
22
23
+ API_VERSION = 0 , 1
24
+
23
25
# XXX: Different timezones?
24
26
_TIMEZONE = 'Europe/Prague'
25
27
Original file line number Diff line number Diff line change @@ -399,12 +399,14 @@ def schema(model_slug, is_input):
399
399
cls = models .models [model_slug ]
400
400
except KeyError :
401
401
abort (404 )
402
- return jsonify (models .get_schema (cls , is_input = is_input ))
402
+ return jsonify (models .get_schema (
403
+ cls , is_input = is_input , version = models .API_VERSION ,
404
+ ))
403
405
404
406
405
407
@app .route ('/v0/naucse.json' )
406
408
def api ():
407
- return jsonify (models .dump (g .model ))
409
+ return jsonify (models .dump (g .model , version = models . API_VERSION ))
408
410
409
411
410
412
@app .route ('/v0/years/<int:year>.json' )
@@ -413,7 +415,7 @@ def run_year_api(year):
413
415
run_year = g .model .run_years [year ]
414
416
except KeyError :
415
417
abort (404 )
416
- return jsonify (models .dump (run_year ))
418
+ return jsonify (models .dump (run_year , version = models . API_VERSION ))
417
419
418
420
419
421
@app .route ('/v0/<course:course_slug>.json' )
@@ -422,4 +424,4 @@ def course_api(course_slug):
422
424
course = g .model .courses [course_slug ]
423
425
except KeyError :
424
426
abort (404 )
425
- return jsonify (models .dump (course ))
427
+ return jsonify (models .dump (course , version = models . API_VERSION ))
You can’t perform that action at this time.
0 commit comments