test tiramisu-json version
This commit is contained in:
parent
a0b08ea1c8
commit
dae6779e72
|
@ -9,6 +9,8 @@ from .setting import undefined
|
||||||
from .i18n import _
|
from .i18n import _
|
||||||
|
|
||||||
|
|
||||||
|
TIRAMISU_JSON_VERSION = '1.0'
|
||||||
|
|
||||||
|
|
||||||
TYPE = {'boolean': bool,
|
TYPE = {'boolean': bool,
|
||||||
'integer': int,
|
'integer': int,
|
||||||
|
@ -488,6 +490,8 @@ class Config:
|
||||||
# config
|
# config
|
||||||
def __init__(self,
|
def __init__(self,
|
||||||
json):
|
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.model = json['model']
|
||||||
self.form = json['form']
|
self.form = json['form']
|
||||||
self.form = {}
|
self.form = {}
|
||||||
|
|
Loading…
Reference in New Issue