1
0
Fork 0
mirror of https://github.com/yweber/lodel2.git synced 2025-11-25 23:06:55 +01:00
lodel2_mirror/refreshdyn.py
Yann 4b4e465bb6 Implements utils function in LeType add_superior (hierarchy) and link_with (rel2type) and add a forgotten file
Implements a utils method in _LeRel2Type to fetch a rel2type leapi class name given a superior and a subordinate
2015-12-02 16:09:48 +01:00

18 lines
537 B
Python
Executable file

# -*- coding: utf-8 -*-
import sys
from EditorialModel.model import Model
from leapi.lefactory import LeFactory
from EditorialModel.backend.json_backend import EmBackendJson
from DataSource.MySQL.leapidatasource import LeDataSourceSQL
OUTPUT = 'leapi/dyn.py' if len(sys.argv) == 1 else sys.argv[1]
EMJSON = 'EditorialModel/test/me.json' if len(sys.argv) < 3 else sys.argv[2]
em = Model(EmBackendJson(EMJSON))
fact = LeFactory(OUTPUT)
fact.create_pyfile(em, LeDataSourceSQL, {})
print(fact.generate_python(em, LeDataSourceSQL, {}))