From dae6779e72cedc63c5449d450377a56aad4d2488 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Wed, 3 Apr 2019 19:48:45 +0200 Subject: [PATCH] test tiramisu-json version --- tiramisu_json_api/api.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tiramisu_json_api/api.py b/tiramisu_json_api/api.py index eb58e7b..8026194 100644 --- a/tiramisu_json_api/api.py +++ b/tiramisu_json_api/api.py @@ -9,6 +9,8 @@ from .setting import undefined from .i18n import _ +TIRAMISU_JSON_VERSION = '1.0' + TYPE = {'boolean': bool, 'integer': int, @@ -488,6 +490,8 @@ class Config: # config def __init__(self, json): + if json.get('version') != TIRAMISU_JSON_VERSION: + raise Exception('incompatible tiramisu-json format version (got {}, expected {})'.format(json.get('version', '0.0'), TIRAMISU_JSON_VERSION)) self.model = json['model'] self.form = json['form'] self.form = {}