SlideShare una empresa de Scribd logo
1 de 22
Descargar para leer sin conexión
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…

Más contenido relacionado

La actualidad más candente

Modificateurs d'accès en java
Modificateurs d'accès en javaModificateurs d'accès en java
Modificateurs d'accès en javaMohamed Bah
 
DLL(dynamic link library)
DLL(dynamic link library)DLL(dynamic link library)
DLL(dynamic link library)pooja_doshi
 
Introduction to Python programming
Introduction to Python programmingIntroduction to Python programming
Introduction to Python programmingDamian T. Gordon
 
Basic concepts for python web development
Basic concepts for python web developmentBasic concepts for python web development
Basic concepts for python web developmentNexSoftsys
 
What is Dictionary In Python? Python Dictionary Tutorial | Edureka
What is Dictionary In Python? Python Dictionary Tutorial | EdurekaWhat is Dictionary In Python? Python Dictionary Tutorial | Edureka
What is Dictionary In Python? Python Dictionary Tutorial | EdurekaEdureka!
 
Security DevOps - Free pentesters' time to focus on high-hanging fruits // Ha...
Security DevOps - Free pentesters' time to focus on high-hanging fruits // Ha...Security DevOps - Free pentesters' time to focus on high-hanging fruits // Ha...
Security DevOps - Free pentesters' time to focus on high-hanging fruits // Ha...Christian Schneider
 
JSR381 Visual Recognition for Java.pdf
JSR381 Visual Recognition for Java.pdfJSR381 Visual Recognition for Java.pdf
JSR381 Visual Recognition for Java.pdfZoran Sevarac, PhD
 
Java Input Output and File Handling
Java Input Output and File HandlingJava Input Output and File Handling
Java Input Output and File HandlingSunil OS
 
ms-sql-server-150223140402-conversion-gate02.pptx
ms-sql-server-150223140402-conversion-gate02.pptxms-sql-server-150223140402-conversion-gate02.pptx
ms-sql-server-150223140402-conversion-gate02.pptxYashaswiniSrinivasan1
 
iOS Coding Best Practices
iOS Coding Best PracticesiOS Coding Best Practices
iOS Coding Best PracticesJean-Luc David
 
Android - Tp1 - installation et démarrage
Android - Tp1 -   installation et démarrageAndroid - Tp1 -   installation et démarrage
Android - Tp1 - installation et démarrageLilia Sfaxi
 
Django Tutorial | Django Web Development With Python | Django Training and Ce...
Django Tutorial | Django Web Development With Python | Django Training and Ce...Django Tutorial | Django Web Development With Python | Django Training and Ce...
Django Tutorial | Django Web Development With Python | Django Training and Ce...Edureka!
 
.NET and C# introduction
.NET and C# introduction.NET and C# introduction
.NET and C# introductionPeter Gfader
 
Hibernate ppt
Hibernate pptHibernate ppt
Hibernate pptAneega
 
Hibernate architecture
Hibernate architectureHibernate architecture
Hibernate architectureAnurag
 

La actualidad más candente (20)

Modificateurs d'accès en java
Modificateurs d'accès en javaModificateurs d'accès en java
Modificateurs d'accès en java
 
Database Connection
Database ConnectionDatabase Connection
Database Connection
 
DLL(dynamic link library)
DLL(dynamic link library)DLL(dynamic link library)
DLL(dynamic link library)
 
Introduction to Python programming
Introduction to Python programmingIntroduction to Python programming
Introduction to Python programming
 
Basic concepts for python web development
Basic concepts for python web developmentBasic concepts for python web development
Basic concepts for python web development
 
What is Dictionary In Python? Python Dictionary Tutorial | Edureka
What is Dictionary In Python? Python Dictionary Tutorial | EdurekaWhat is Dictionary In Python? Python Dictionary Tutorial | Edureka
What is Dictionary In Python? Python Dictionary Tutorial | Edureka
 
Security DevOps - Free pentesters' time to focus on high-hanging fruits // Ha...
Security DevOps - Free pentesters' time to focus on high-hanging fruits // Ha...Security DevOps - Free pentesters' time to focus on high-hanging fruits // Ha...
Security DevOps - Free pentesters' time to focus on high-hanging fruits // Ha...
 
JSR381 Visual Recognition for Java.pdf
JSR381 Visual Recognition for Java.pdfJSR381 Visual Recognition for Java.pdf
JSR381 Visual Recognition for Java.pdf
 
Java Input Output and File Handling
Java Input Output and File HandlingJava Input Output and File Handling
Java Input Output and File Handling
 
Python/Django Training
Python/Django TrainingPython/Django Training
Python/Django Training
 
ms-sql-server-150223140402-conversion-gate02.pptx
ms-sql-server-150223140402-conversion-gate02.pptxms-sql-server-150223140402-conversion-gate02.pptx
ms-sql-server-150223140402-conversion-gate02.pptx
 
iOS Coding Best Practices
iOS Coding Best PracticesiOS Coding Best Practices
iOS Coding Best Practices
 
Android Intent.pptx
Android Intent.pptxAndroid Intent.pptx
Android Intent.pptx
 
Android - Tp1 - installation et démarrage
Android - Tp1 -   installation et démarrageAndroid - Tp1 -   installation et démarrage
Android - Tp1 - installation et démarrage
 
Django Tutorial | Django Web Development With Python | Django Training and Ce...
Django Tutorial | Django Web Development With Python | Django Training and Ce...Django Tutorial | Django Web Development With Python | Django Training and Ce...
Django Tutorial | Django Web Development With Python | Django Training and Ce...
 
C# File IO Operations
C# File IO OperationsC# File IO Operations
C# File IO Operations
 
.NET and C# introduction
.NET and C# introduction.NET and C# introduction
.NET and C# introduction
 
Hibernate ppt
Hibernate pptHibernate ppt
Hibernate ppt
 
Java ppt
Java pptJava ppt
Java ppt
 
Hibernate architecture
Hibernate architectureHibernate architecture
Hibernate architecture
 

Similar a 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
 

Similar a 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
 

Más de Laurent Guérin

Microservices-DDD-Telosys-Devoxx-FR-2022
Microservices-DDD-Telosys-Devoxx-FR-2022Microservices-DDD-Telosys-Devoxx-FR-2022
Microservices-DDD-Telosys-Devoxx-FR-2022Laurent Guérin
 
Telosys project booster Paris Open Source Summit 2019
Telosys project booster Paris Open Source Summit 2019Telosys project booster Paris Open Source Summit 2019
Telosys project booster Paris Open Source Summit 2019Laurent 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
 

Más de Laurent Guérin (13)

Microservices-DDD-Telosys-Devoxx-FR-2022
Microservices-DDD-Telosys-Devoxx-FR-2022Microservices-DDD-Telosys-Devoxx-FR-2022
Microservices-DDD-Telosys-Devoxx-FR-2022
 
Telosys project booster Paris Open Source Summit 2019
Telosys project booster Paris Open Source Summit 2019Telosys project booster Paris Open Source Summit 2019
Telosys project booster Paris Open Source Summit 2019
 
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
 

Último

SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 

Último (20)

SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine 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…