SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Downloaden Sie, um offline zu lesen
1
Telosys tutorial
for
Python – MVC / SQL application
2
Web browser
APPLICATION ARCHITECTURE
Controllers Services
Views
D.A.O.
Entities
What we want to generate :
3
For this tutorial we need Python 3 with frameworks « Bottle » and « SQLAlchemy »
Check « Python 3 » and « pip » are installed
> python --version
> pip --version
Install « Bottle »
> pip install bottle
Install « SQLAlchemy »
> pip install SQLAlchemy
List installed packages
> pip list
PREREQUISITES
4
Telosys CLI
installation
5
Create 2 folders : « tuto » and « tuto/project »
Check Java version ( Java 1.8 or + required )
> java -version
Download Telosys-CLI
from https://www.telosys.org/download/telosys-cli/
in « tuto » folder
Unzip Telosys-CLI in the « tuto » folder
If you want Telosys to use your preferred editor
just define it in the ”telosys-cli.cfg” file
Example for « Notepad++ » :
EditorCommand = "C:/Program Files (x86)/Notepad++/notepad++.exe" $FILE
INSTALL TELOSYS-CLI
Telosys-CLI files after « unzip » :
Telosys-CLI is packaged
in a “.zip” file
6
Open a Command Prompt in « tuto » folder
and run « tt » command (shell file or .bat file )
Print commands help :
telosys> ?
Print current directory :
telosys> pwd
Change current directory to « tuto /project »
telosys> cd project
Set home directory ( project directory ) :
telosys> h .
Initialize the Telosys tools in the project :
telosys> init
LAUNCH TELOSYS-CLI AND INITIALIZE THE PROJECT
7
Step 1 - Model setup
( entities definition )
8
Create a new model « students » :
telosys> nm students
List existing models :
telosys> lm
List entities defined in the current model :
telosys> le
Create a new entity « student » :
telosys> ne student
List entities :
telosys> le
Edit entity « student »
telosys> ee student
Check the current model
telosys> cm
HOW TO CREATE A MODEL FROM SCRATCH
The current model is
displayed in the prompt
9
If you don’t want to create a full model from scratch
you can download an existing model :
http://www.telosys.org/download/models-v3/
In « /tuto/project/TelosysTools »
Unzip ( « Extract here » )
List models :
telosys> lm
Select the « cars » model :
telosys> m cars
List entities :
telosys> le
Edit entity « Car »:
telosys> ee car
DOWNLOAD THE « CARS » MODEL
10
Step 2 - Templates installation
11
PYTHON BUNDLES AVAILABLE ON GITHUB
See : https://github.com/telosys-templates-v3
12
For our application we need 2 bundles of templates :
• 1 bundle for the persistence layer
• 1 bundle for the web MVC layer
REQUIRED BUNDLES OF TEMPLATES
Web browser
Controllers Services
Views
D.A.O.
Entities
python-web-mvc-bottle python-persistence-sqlalchemy
13
Print current GitHub store :
telosys> gh
List all bundles available on GitHub :
telosys> lgh
List bundles containing “pyt” on GitHub :
telosys> lgh pyt
Install bundles containing “pyt” :
telosys> ib pyt
List installed bundles :
telosys> lb
INSTALL BUNDLES OF TEMPLATES
14
Step 3 - Code generation
15
Select the bundle of templates for the MVC layer ( “python-web-mvc-bottle” )
 select bundle containing “mvc” :
telosys> b mvc
Launch generation :
telosys> gen * * -r
( generate all entities
target files using
all templates and
copy static resources
if any )
USE « Web MVC » FOR CODE GENERATION
16
For each entity :
• “form” template
• “list” template
« Web MVC » GENERATION RESULT
A controller for each entity
Home page controller
& utility functions
17
Select bundle containing “sqlal” :
telosys> b sqlal
Launch generation :
telosys> gen * * -r
USE « Persistence SQL Alchemy » FOR CODE GENERATION
18
« Persistence SQL Alchemy » GENERATION RESULT
A DAO for each entity
A domain class for each entity
A persistence service for each entity
A unit test for each DAO
19
Now let’s use the
generated code…
20
Initialize database and launch DAO tests
1) Create the SQLite database
Launch “create_database.py”
( creates the SQLite file “database.sqlite” )
2) Initialize the database :
Launch “init_database.py”
( insert few records in each table )
3) Launch DAO unit tests :
Launch “run_tests.py”
21
1) Start the web application
Launch “app.py”
( creates the SQLite file “database.sqlite” )
2) Test the application with a web browser
http://localhost:3000/
Launch the generated web application
22
That's it !
Now you can customize
the entities or the templates…

Weitere ähnliche Inhalte

Was ist angesagt?

softCours design pattern m youssfi partie 9 creation des objets abstract fact...
softCours design pattern m youssfi partie 9 creation des objets abstract fact...softCours design pattern m youssfi partie 9 creation des objets abstract fact...
softCours design pattern m youssfi partie 9 creation des objets abstract fact...ENSET, Université Hassan II Casablanca
 
Technologies sur angular.pptx
Technologies sur angular.pptxTechnologies sur angular.pptx
Technologies sur angular.pptxIdrissaDembl
 
Architecture jee principe de inversion de controle et injection des dependances
Architecture jee principe de inversion de controle et injection des dependancesArchitecture jee principe de inversion de controle et injection des dependances
Architecture jee principe de inversion de controle et injection des dependancesENSET, Université Hassan II Casablanca
 
Introduction à spring boot
Introduction à spring bootIntroduction à spring boot
Introduction à spring bootAntoine Rey
 
Microservices avec Spring Cloud
Microservices avec Spring CloudMicroservices avec Spring Cloud
Microservices avec Spring CloudFlorian Beaufumé
 
A la découverte de vue.js
A la découverte de vue.jsA la découverte de vue.js
A la découverte de vue.jsBruno Bonnin
 

Was ist angesagt? (20)

softCours design pattern m youssfi partie 9 creation des objets abstract fact...
softCours design pattern m youssfi partie 9 creation des objets abstract fact...softCours design pattern m youssfi partie 9 creation des objets abstract fact...
softCours design pattern m youssfi partie 9 creation des objets abstract fact...
 
Docker
DockerDocker
Docker
 
Support JEE Spring Inversion de Controle IOC et Spring MVC
Support JEE Spring Inversion de Controle IOC et Spring MVCSupport JEE Spring Inversion de Controle IOC et Spring MVC
Support JEE Spring Inversion de Controle IOC et Spring MVC
 
Technologies sur angular.pptx
Technologies sur angular.pptxTechnologies sur angular.pptx
Technologies sur angular.pptx
 
Maven et industrialisation du logiciel
Maven et industrialisation du logicielMaven et industrialisation du logiciel
Maven et industrialisation du logiciel
 
Architecture jee principe de inversion de controle et injection des dependances
Architecture jee principe de inversion de controle et injection des dependancesArchitecture jee principe de inversion de controle et injection des dependances
Architecture jee principe de inversion de controle et injection des dependances
 
Support Web Services SOAP et RESTful Mr YOUSSFI
Support Web Services SOAP et RESTful Mr YOUSSFISupport Web Services SOAP et RESTful Mr YOUSSFI
Support Web Services SOAP et RESTful Mr YOUSSFI
 
NestJS
NestJSNestJS
NestJS
 
Introduction à spring boot
Introduction à spring bootIntroduction à spring boot
Introduction à spring boot
 
Servlets et JSP
Servlets et JSPServlets et JSP
Servlets et JSP
 
Microservices avec Spring Cloud
Microservices avec Spring CloudMicroservices avec Spring Cloud
Microservices avec Spring Cloud
 
Support Java Avancé Troisième Partie
Support Java Avancé Troisième PartieSupport Java Avancé Troisième Partie
Support Java Avancé Troisième Partie
 
Cours design pattern m youssfi partie 6 proxy
Cours design pattern m youssfi partie 6 proxyCours design pattern m youssfi partie 6 proxy
Cours design pattern m youssfi partie 6 proxy
 
Support developpement applications mobiles avec ionic v3 et v4
Support developpement applications mobiles avec ionic v3 et v4Support developpement applications mobiles avec ionic v3 et v4
Support developpement applications mobiles avec ionic v3 et v4
 
Les Servlets et JSP
Les Servlets et JSPLes Servlets et JSP
Les Servlets et JSP
 
A la découverte de vue.js
A la découverte de vue.jsA la découverte de vue.js
A la découverte de vue.js
 
Devops | CICD Pipeline
Devops | CICD PipelineDevops | CICD Pipeline
Devops | CICD Pipeline
 
Traitement distribue en BIg Data - KAFKA Broker and Kafka Streams
Traitement distribue en BIg Data - KAFKA Broker and Kafka StreamsTraitement distribue en BIg Data - KAFKA Broker and Kafka Streams
Traitement distribue en BIg Data - KAFKA Broker and Kafka Streams
 
Support POO Java première partie
Support POO Java première partieSupport POO Java première partie
Support POO Java première partie
 
Support de cours technologie et application m.youssfi
Support de cours technologie et application m.youssfiSupport de cours technologie et application m.youssfi
Support de cours technologie et application m.youssfi
 

Ähnlich wie Telosys tutorial - Code generation for a Python web application based on Bottle and SQLAlchemy

PVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOps
PVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOpsPVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOps
PVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOpsAndrey Karpov
 
Overview of CSharp MVC3 and EF4
Overview of CSharp MVC3 and EF4Overview of CSharp MVC3 and EF4
Overview of CSharp MVC3 and EF4Rich Helton
 
Azure DevOps Extensions
Azure DevOps ExtensionsAzure DevOps Extensions
Azure DevOps ExtensionsChristian Waha
 
Setting up your virtual infrastructure using fi-lab cloud
Setting up your virtual infrastructure using fi-lab cloudSetting up your virtual infrastructure using fi-lab cloud
Setting up your virtual infrastructure using fi-lab cloudFernando Lopez Aguilar
 
Microservices Server - MSS Workshop
Microservices Server - MSS WorkshopMicroservices Server - MSS Workshop
Microservices Server - MSS WorkshopWSO2
 
Workshop/Tutorial WSO2 Micro Services Server
Workshop/Tutorial WSO2 Micro Services ServerWorkshop/Tutorial WSO2 Micro Services Server
Workshop/Tutorial WSO2 Micro Services ServerEdgar Silva
 
Workshop MSF4J - Getting Started with Microservices and Java
Workshop MSF4J - Getting Started with Microservices and JavaWorkshop MSF4J - Getting Started with Microservices and Java
Workshop MSF4J - Getting Started with Microservices and JavaEdgar Silva
 
Openshift cheat rhce_r3v1 rhce
Openshift cheat rhce_r3v1 rhceOpenshift cheat rhce_r3v1 rhce
Openshift cheat rhce_r3v1 rhceDarnette A
 
Steps how to create active x using visual studio 2008
Steps how to create active x using visual studio 2008Steps how to create active x using visual studio 2008
Steps how to create active x using visual studio 2008Yudep Apoi
 
Cello Saas getting started
Cello Saas getting startedCello Saas getting started
Cello Saas getting startedkanimozhin
 
Refresh Austin - Intro to Dexy
Refresh Austin - Intro to DexyRefresh Austin - Intro to Dexy
Refresh Austin - Intro to Dexyananelson
 
CelloSaaS Getting Started
CelloSaaS Getting StartedCelloSaaS Getting Started
CelloSaaS Getting StartedTechcello
 
AWS December 2015 Webinar Series - Continuous Delivery to Amazon EC2 Containe...
AWS December 2015 Webinar Series - Continuous Delivery to Amazon EC2 Containe...AWS December 2015 Webinar Series - Continuous Delivery to Amazon EC2 Containe...
AWS December 2015 Webinar Series - Continuous Delivery to Amazon EC2 Containe...Amazon Web Services
 
What's new in asp.net mvc 4
What's new in asp.net mvc 4What's new in asp.net mvc 4
What's new in asp.net mvc 4Simone Chiaretta
 
Introduction to Docker - Vellore Institute of Technology
Introduction to Docker - Vellore Institute of TechnologyIntroduction to Docker - Vellore Institute of Technology
Introduction to Docker - Vellore Institute of TechnologyAjeet Singh Raina
 
Spring Live Sample Chapter
Spring Live Sample ChapterSpring Live Sample Chapter
Spring Live Sample ChapterSyed Shahul
 

Ähnlich wie Telosys tutorial - Code generation for a Python web application based on Bottle and SQLAlchemy (20)

Mon application web en 20 minutes
Mon application web en 20 minutesMon application web en 20 minutes
Mon application web en 20 minutes
 
PVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOps
PVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOpsPVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOps
PVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOps
 
Docker Starter Pack
Docker Starter PackDocker Starter Pack
Docker Starter Pack
 
Overview of CSharp MVC3 and EF4
Overview of CSharp MVC3 and EF4Overview of CSharp MVC3 and EF4
Overview of CSharp MVC3 and EF4
 
Azure DevOps Extensions
Azure DevOps ExtensionsAzure DevOps Extensions
Azure DevOps Extensions
 
Setting up your virtual infrastructure using fi-lab cloud
Setting up your virtual infrastructure using fi-lab cloudSetting up your virtual infrastructure using fi-lab cloud
Setting up your virtual infrastructure using fi-lab cloud
 
Microservices Server - MSS Workshop
Microservices Server - MSS WorkshopMicroservices Server - MSS Workshop
Microservices Server - MSS Workshop
 
Workshop/Tutorial WSO2 Micro Services Server
Workshop/Tutorial WSO2 Micro Services ServerWorkshop/Tutorial WSO2 Micro Services Server
Workshop/Tutorial WSO2 Micro Services Server
 
Workshop MSF4J - Getting Started with Microservices and Java
Workshop MSF4J - Getting Started with Microservices and JavaWorkshop MSF4J - Getting Started with Microservices and Java
Workshop MSF4J - Getting Started with Microservices and Java
 
Openshift cheat rhce_r3v1 rhce
Openshift cheat rhce_r3v1 rhceOpenshift cheat rhce_r3v1 rhce
Openshift cheat rhce_r3v1 rhce
 
Steps how to create active x using visual studio 2008
Steps how to create active x using visual studio 2008Steps how to create active x using visual studio 2008
Steps how to create active x using visual studio 2008
 
Cello Saas getting started
Cello Saas getting startedCello Saas getting started
Cello Saas getting started
 
Refresh Austin - Intro to Dexy
Refresh Austin - Intro to DexyRefresh Austin - Intro to Dexy
Refresh Austin - Intro to Dexy
 
CelloSaaS Getting Started
CelloSaaS Getting StartedCelloSaaS Getting Started
CelloSaaS Getting Started
 
AWS December 2015 Webinar Series - Continuous Delivery to Amazon EC2 Containe...
AWS December 2015 Webinar Series - Continuous Delivery to Amazon EC2 Containe...AWS December 2015 Webinar Series - Continuous Delivery to Amazon EC2 Containe...
AWS December 2015 Webinar Series - Continuous Delivery to Amazon EC2 Containe...
 
What's new in asp.net mvc 4
What's new in asp.net mvc 4What's new in asp.net mvc 4
What's new in asp.net mvc 4
 
Readme
ReadmeReadme
Readme
 
Introduction to Docker - Vellore Institute of Technology
Introduction to Docker - Vellore Institute of TechnologyIntroduction to Docker - Vellore Institute of Technology
Introduction to Docker - Vellore Institute of Technology
 
Microservices in Java
Microservices in JavaMicroservices in Java
Microservices in Java
 
Spring Live Sample Chapter
Spring Live Sample ChapterSpring Live Sample Chapter
Spring Live Sample Chapter
 

Mehr von Laurent Guérin

MQTT avec Mosquitto et Paho - DevFest Brest 2019
MQTT avec Mosquitto et Paho - DevFest Brest 2019MQTT avec Mosquitto et Paho - DevFest Brest 2019
MQTT avec Mosquitto et Paho - DevFest Brest 2019Laurent Guérin
 
MQTT avec Mosquitto et Paho - Laurent Guerin - JUG Nantes Nov 2018
MQTT avec Mosquitto et Paho - Laurent Guerin - JUG Nantes Nov 2018MQTT avec Mosquitto et Paho - Laurent Guerin - JUG Nantes Nov 2018
MQTT avec Mosquitto et Paho - Laurent Guerin - JUG Nantes Nov 2018Laurent Guérin
 
Meetup python-bottle-telosys-2018-lgu-v1.0
Meetup python-bottle-telosys-2018-lgu-v1.0Meetup python-bottle-telosys-2018-lgu-v1.0
Meetup python-bottle-telosys-2018-lgu-v1.0Laurent Guérin
 
Sogeti labs developer-today-v1.1
Sogeti labs developer-today-v1.1Sogeti labs developer-today-v1.1
Sogeti labs developer-today-v1.1Laurent Guérin
 
DevOps MeetUp NL - Docker (Oct 2014)
DevOps MeetUp NL - Docker (Oct 2014)DevOps MeetUp NL - Docker (Oct 2014)
DevOps MeetUp NL - Docker (Oct 2014)Laurent Guérin
 
Telosys tools jug-nantes-2014-v1.2
Telosys tools jug-nantes-2014-v1.2Telosys tools jug-nantes-2014-v1.2
Telosys tools jug-nantes-2014-v1.2Laurent Guérin
 
Bean Validation - Cours v 1.1
Bean Validation - Cours v 1.1Bean Validation - Cours v 1.1
Bean Validation - Cours v 1.1Laurent Guérin
 
Genie logiciel eseo-v1.1-1spp
Genie logiciel eseo-v1.1-1sppGenie logiciel eseo-v1.1-1spp
Genie logiciel eseo-v1.1-1sppLaurent Guérin
 
Devoxx 2011 - Scaffolding with Telosys
Devoxx 2011 - Scaffolding with TelosysDevoxx 2011 - Scaffolding with Telosys
Devoxx 2011 - Scaffolding with TelosysLaurent Guérin
 
Open World Forum 2009 Migration With Telosys
Open World Forum 2009 Migration With TelosysOpen World Forum 2009 Migration With Telosys
Open World Forum 2009 Migration With TelosysLaurent Guérin
 
Solutions Linux Développement Rapide Java
Solutions Linux Développement Rapide JavaSolutions Linux Développement Rapide Java
Solutions Linux Développement Rapide JavaLaurent Guérin
 

Mehr von Laurent Guérin (11)

MQTT avec Mosquitto et Paho - DevFest Brest 2019
MQTT avec Mosquitto et Paho - DevFest Brest 2019MQTT avec Mosquitto et Paho - DevFest Brest 2019
MQTT avec Mosquitto et Paho - DevFest Brest 2019
 
MQTT avec Mosquitto et Paho - Laurent Guerin - JUG Nantes Nov 2018
MQTT avec Mosquitto et Paho - Laurent Guerin - JUG Nantes Nov 2018MQTT avec Mosquitto et Paho - Laurent Guerin - JUG Nantes Nov 2018
MQTT avec Mosquitto et Paho - Laurent Guerin - JUG Nantes Nov 2018
 
Meetup python-bottle-telosys-2018-lgu-v1.0
Meetup python-bottle-telosys-2018-lgu-v1.0Meetup python-bottle-telosys-2018-lgu-v1.0
Meetup python-bottle-telosys-2018-lgu-v1.0
 
Sogeti labs developer-today-v1.1
Sogeti labs developer-today-v1.1Sogeti labs developer-today-v1.1
Sogeti labs developer-today-v1.1
 
DevOps MeetUp NL - Docker (Oct 2014)
DevOps MeetUp NL - Docker (Oct 2014)DevOps MeetUp NL - Docker (Oct 2014)
DevOps MeetUp NL - Docker (Oct 2014)
 
Telosys tools jug-nantes-2014-v1.2
Telosys tools jug-nantes-2014-v1.2Telosys tools jug-nantes-2014-v1.2
Telosys tools jug-nantes-2014-v1.2
 
Bean Validation - Cours v 1.1
Bean Validation - Cours v 1.1Bean Validation - Cours v 1.1
Bean Validation - Cours v 1.1
 
Genie logiciel eseo-v1.1-1spp
Genie logiciel eseo-v1.1-1sppGenie logiciel eseo-v1.1-1spp
Genie logiciel eseo-v1.1-1spp
 
Devoxx 2011 - Scaffolding with Telosys
Devoxx 2011 - Scaffolding with TelosysDevoxx 2011 - Scaffolding with Telosys
Devoxx 2011 - Scaffolding with Telosys
 
Open World Forum 2009 Migration With Telosys
Open World Forum 2009 Migration With TelosysOpen World Forum 2009 Migration With Telosys
Open World Forum 2009 Migration With Telosys
 
Solutions Linux Développement Rapide Java
Solutions Linux Développement Rapide JavaSolutions Linux Développement Rapide Java
Solutions Linux Développement Rapide Java
 

Kürzlich hochgeladen

CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
How To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTROHow To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTROmotivationalword821
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 

Kürzlich hochgeladen (20)

CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
How To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTROHow To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTRO
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 

Telosys tutorial - Code generation for a Python web application based on Bottle and SQLAlchemy

  • 1. 1 Telosys tutorial for Python – MVC / SQL application
  • 2. 2 Web browser APPLICATION ARCHITECTURE Controllers Services Views D.A.O. Entities What we want to generate :
  • 3. 3 For this tutorial we need Python 3 with frameworks « Bottle » and « SQLAlchemy » Check « Python 3 » and « pip » are installed > python --version > pip --version Install « Bottle » > pip install bottle Install « SQLAlchemy » > pip install SQLAlchemy List installed packages > pip list PREREQUISITES
  • 5. 5 Create 2 folders : « tuto » and « tuto/project » Check Java version ( Java 1.8 or + required ) > java -version Download Telosys-CLI from https://www.telosys.org/download/telosys-cli/ in « tuto » folder Unzip Telosys-CLI in the « tuto » folder If you want Telosys to use your preferred editor just define it in the ”telosys-cli.cfg” file Example for « Notepad++ » : EditorCommand = "C:/Program Files (x86)/Notepad++/notepad++.exe" $FILE INSTALL TELOSYS-CLI Telosys-CLI files after « unzip » : Telosys-CLI is packaged in a “.zip” file
  • 6. 6 Open a Command Prompt in « tuto » folder and run « tt » command (shell file or .bat file ) Print commands help : telosys> ? Print current directory : telosys> pwd Change current directory to « tuto /project » telosys> cd project Set home directory ( project directory ) : telosys> h . Initialize the Telosys tools in the project : telosys> init LAUNCH TELOSYS-CLI AND INITIALIZE THE PROJECT
  • 7. 7 Step 1 - Model setup ( entities definition )
  • 8. 8 Create a new model « students » : telosys> nm students List existing models : telosys> lm List entities defined in the current model : telosys> le Create a new entity « student » : telosys> ne student List entities : telosys> le Edit entity « student » telosys> ee student Check the current model telosys> cm HOW TO CREATE A MODEL FROM SCRATCH The current model is displayed in the prompt
  • 9. 9 If you don’t want to create a full model from scratch you can download an existing model : http://www.telosys.org/download/models-v3/ In « /tuto/project/TelosysTools » Unzip ( « Extract here » ) List models : telosys> lm Select the « cars » model : telosys> m cars List entities : telosys> le Edit entity « Car »: telosys> ee car DOWNLOAD THE « CARS » MODEL
  • 10. 10 Step 2 - Templates installation
  • 11. 11 PYTHON BUNDLES AVAILABLE ON GITHUB See : https://github.com/telosys-templates-v3
  • 12. 12 For our application we need 2 bundles of templates : • 1 bundle for the persistence layer • 1 bundle for the web MVC layer REQUIRED BUNDLES OF TEMPLATES Web browser Controllers Services Views D.A.O. Entities python-web-mvc-bottle python-persistence-sqlalchemy
  • 13. 13 Print current GitHub store : telosys> gh List all bundles available on GitHub : telosys> lgh List bundles containing “pyt” on GitHub : telosys> lgh pyt Install bundles containing “pyt” : telosys> ib pyt List installed bundles : telosys> lb INSTALL BUNDLES OF TEMPLATES
  • 14. 14 Step 3 - Code generation
  • 15. 15 Select the bundle of templates for the MVC layer ( “python-web-mvc-bottle” )  select bundle containing “mvc” : telosys> b mvc Launch generation : telosys> gen * * -r ( generate all entities target files using all templates and copy static resources if any ) USE « Web MVC » FOR CODE GENERATION
  • 16. 16 For each entity : • “form” template • “list” template « Web MVC » GENERATION RESULT A controller for each entity Home page controller & utility functions
  • 17. 17 Select bundle containing “sqlal” : telosys> b sqlal Launch generation : telosys> gen * * -r USE « Persistence SQL Alchemy » FOR CODE GENERATION
  • 18. 18 « Persistence SQL Alchemy » GENERATION RESULT A DAO for each entity A domain class for each entity A persistence service for each entity A unit test for each DAO
  • 19. 19 Now let’s use the generated code…
  • 20. 20 Initialize database and launch DAO tests 1) Create the SQLite database Launch “create_database.py” ( creates the SQLite file “database.sqlite” ) 2) Initialize the database : Launch “init_database.py” ( insert few records in each table ) 3) Launch DAO unit tests : Launch “run_tests.py”
  • 21. 21 1) Start the web application Launch “app.py” ( creates the SQLite file “database.sqlite” ) 2) Test the application with a web browser http://localhost:3000/ Launch the generated web application
  • 22. 22 That's it ! Now you can customize the entities or the templates…