1
0
Fork 0
mirror of https://github.com/yweber/lodel2.git synced 2026-11-18 00:51:38 +01:00

update README file

This commit is contained in:
ArnAud 2016-01-06 11:46:48 +01:00
commit 8b5e1411c9

View file

@ -1,57 +1,38 @@
Creating a Lodel "instance":
use the lodel_init.sh script :
lodel_init.sh INSTANCE_NAME INSTANCE_WANTED_PATH [LODEL2_LIB_PATH]
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 .
Once the instance is created you can run an interactive python interpreter using :
cd INSTANCE_PATH; python loader.py
If you want to write a script that run is the instance env you have to from loader import *
First test installation :
- use python 3.4
** install dependencies
pip install -r requirements.txt
** Doxygen generation
Dependencies : doxygen graphviz doxypy
Generation : run doxygen in the root folder (where the Doxyfile is)
------
** create local config in settings.py
Copy settings.py.example to settings.py, change the conf to your local settings
Creating a Lodel "instance":
** create DATABASES
use the lodel_init.sh script :
lodel_init.sh INSTANCE_NAME INSTANCE_WANTED_PATH [LODEL2_LIB_PATH]
cd INSTANCE_PATH
Create a database for your instance
mysql
> CREATE DATABASE `lodel2` CHARACTER SET utf8 COLLATE utf8_general_ci;
> GRANT ALL ON `lodel2`.* TO "lodel"@"localhost";
** Generate the code for LeObject API
Edit seetings.py according to your database, install database and dynamic code
make
use refreshdyn.py or :
Once the instance is created you can run an interactive python interpreter using :
python loader.py
```python
# -*- coding: utf-8 -*-
If you want to write a script that run is the instance env you have to use
from loader import *
from EditorialModel.model import Model
from leobject.lefactory import LeFactory
from EditorialModel.backend.json_backend import EmBackendJson
from leobject.datasources.ledatasourcesql import LeDataSourceSQL
-----
OUTPUT = 'leobject/dyn.py'
** Doxygen generation
Dependencies : doxygen graphviz doxypy
Generation : run make doc in the root folder
em = Model(EmBackendJson('EditorialModel/test/me.json'))
pycode = LeFactory.generate_python(EmBackendJson, {'json_file':'EditorialModel/test/me.json'}, LeDataSourceSQL, {})
print(pycode)
with open(OUTPUT, 'w+') as fp:
fp.write(pycode)
```
** create local config in settings.py
Copy settings.py.example to settings.py, change the conf to your local settings
** Tools