|
@@ -1,57 +1,38 @@
|
1
|
|
-Creating a Lodel "instance":
|
2
|
|
-
|
3
|
|
-use the lodel_init.sh script :
|
4
|
|
- lodel_init.sh INSTANCE_NAME INSTANCE_WANTED_PATH [LODEL2_LIB_PATH]
|
5
|
|
-
|
6
|
|
-When you have set the new instance settings ( by editing settings.py in instance directory ) you should be able to create the database structure + dynamic code by running make (without arguments) in the instance directory .
|
7
|
|
-
|
8
|
|
-Once the instance is created you can run an interactive python interpreter using :
|
9
|
|
- cd INSTANCE_PATH; python loader.py
|
10
|
|
-
|
11
|
|
-If you want to write a script that run is the instance env you have to from loader import *
|
12
|
|
-
|
13
|
|
-First test installation :
|
14
|
|
-
|
15
|
1
|
- use python 3.4
|
16
|
2
|
|
17
|
3
|
** install dependencies
|
18
|
4
|
pip install -r requirements.txt
|
19
|
5
|
|
20
|
|
-** Doxygen generation
|
21
|
|
- Dependencies : doxygen graphviz doxypy
|
22
|
|
- Generation : run doxygen in the root folder (where the Doxyfile is)
|
|
6
|
+------
|
23
|
7
|
|
24
|
|
-** create local config in settings.py
|
25
|
|
-Copy settings.py.example to settings.py, change the conf to your local settings
|
|
8
|
+Creating a Lodel "instance":
|
26
|
9
|
|
27
|
|
-** create DATABASES
|
|
10
|
+use the lodel_init.sh script :
|
|
11
|
+ lodel_init.sh INSTANCE_NAME INSTANCE_WANTED_PATH [LODEL2_LIB_PATH]
|
|
12
|
+ cd INSTANCE_PATH
|
|
13
|
+
|
|
14
|
+Create a database for your instance
|
28
|
15
|
mysql
|
29
|
16
|
> CREATE DATABASE `lodel2` CHARACTER SET utf8 COLLATE utf8_general_ci;
|
30
|
17
|
> GRANT ALL ON `lodel2`.* TO "lodel"@"localhost";
|
31
|
18
|
|
32
|
|
-** Generate the code for LeObject API
|
33
|
|
-
|
34
|
|
-use refreshdyn.py or :
|
35
|
|
-
|
36
|
|
-```python
|
37
|
|
-# -*- coding: utf-8 -*-
|
|
19
|
+Edit seetings.py according to your database, install database and dynamic code
|
|
20
|
+ make
|
38
|
21
|
|
39
|
|
-from EditorialModel.model import Model
|
40
|
|
-from leobject.lefactory import LeFactory
|
41
|
|
-from EditorialModel.backend.json_backend import EmBackendJson
|
42
|
|
-from leobject.datasources.ledatasourcesql import LeDataSourceSQL
|
43
|
|
-
|
44
|
|
-OUTPUT = 'leobject/dyn.py'
|
|
22
|
+Once the instance is created you can run an interactive python interpreter using :
|
|
23
|
+ python loader.py
|
45
|
24
|
|
46
|
|
-em = Model(EmBackendJson('EditorialModel/test/me.json'))
|
|
25
|
+If you want to write a script that run is the instance env you have to use
|
|
26
|
+ from loader import *
|
47
|
27
|
|
48
|
|
-pycode = LeFactory.generate_python(EmBackendJson, {'json_file':'EditorialModel/test/me.json'}, LeDataSourceSQL, {})
|
|
28
|
+-----
|
49
|
29
|
|
50
|
|
-print(pycode)
|
|
30
|
+** Doxygen generation
|
|
31
|
+ Dependencies : doxygen graphviz doxypy
|
|
32
|
+ Generation : run make doc in the root folder
|
51
|
33
|
|
52
|
|
-with open(OUTPUT, 'w+') as fp:
|
53
|
|
- fp.write(pycode)
|
54
|
|
-```
|
|
34
|
+** create local config in settings.py
|
|
35
|
+Copy settings.py.example to settings.py, change the conf to your local settings
|
55
|
36
|
|
56
|
37
|
** Tools
|
57
|
38
|
|