SlideShare a Scribd company logo
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…

More Related Content

What's hot

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
ENSET, Université Hassan II Casablanca
 
Architetture a Microservizi con Docker Container
Architetture a Microservizi con Docker ContainerArchitetture a Microservizi con Docker Container
Architetture a Microservizi con Docker Container
Roberto Messora
 
Présentation de Django @ Orange Labs (FR)
Présentation de Django @ Orange Labs (FR)Présentation de Django @ Orange Labs (FR)
Présentation de Django @ Orange Labs (FR)
Martin Latrille
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
Steffen Gebert
 
Vuex
VuexVuex
Spring ioc
Spring iocSpring ioc
Spring ioc
Lhouceine OUHAMZA
 
Jenkins presentation
Jenkins presentationJenkins presentation
Jenkins presentation
Valentin Buryakov
 
JDBC: Gestion des bases de données en Java
JDBC: Gestion des bases de données en Java JDBC: Gestion des bases de données en Java
JDBC: Gestion des bases de données en Java
Youness Boukouchi
 
JEE_Chapter4_JSF_VF (1).pdf
JEE_Chapter4_JSF_VF (1).pdfJEE_Chapter4_JSF_VF (1).pdf
JEE_Chapter4_JSF_VF (1).pdf
MahmoudiOussama
 
Nouveautés Java 9-10-11
Nouveautés Java 9-10-11Nouveautés Java 9-10-11
Nouveautés Java 9-10-11
Mahamadou TOURE, Ph.D.
 
Difference between Java and c#
Difference between Java and c#Difference between Java and c#
Difference between Java and c#
Sagar Pednekar
 
Introduction JavaEE
Introduction JavaEEIntroduction JavaEE
Introduction JavaEE
Mourad HASSINI
 
Maven et industrialisation du logiciel
Maven et industrialisation du logicielMaven et industrialisation du logiciel
Maven et industrialisation du logiciel
ENSET, Université Hassan II Casablanca
 
Formation PHP
Formation PHPFormation PHP
Formation PHP
kemenaran
 
Java entreprise edition et industrialisation du génie logiciel par m.youssfi
Java entreprise edition et industrialisation du génie logiciel par m.youssfiJava entreprise edition et industrialisation du génie logiciel par m.youssfi
Java entreprise edition et industrialisation du génie logiciel par m.youssfi
ENSET, Université Hassan II Casablanca
 
Presentation Spring, Spring MVC
Presentation Spring, Spring MVCPresentation Spring, Spring MVC
Presentation Spring, Spring MVCNathaniel Richand
 
Introduction à Angular
Introduction à AngularIntroduction à Angular
Introduction à Angular
Jean-Baptiste Vigneron
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
Lhouceine OUHAMZA
 
Docker Container Security
Docker Container SecurityDocker Container Security
Docker Container Security
Suraj Khetani
 
Java DataBase Connectivity API (JDBC API)
Java DataBase Connectivity API (JDBC API)Java DataBase Connectivity API (JDBC API)
Java DataBase Connectivity API (JDBC API)
Luzan Baral
 

What's hot (20)

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
 
Architetture a Microservizi con Docker Container
Architetture a Microservizi con Docker ContainerArchitetture a Microservizi con Docker Container
Architetture a Microservizi con Docker Container
 
Présentation de Django @ Orange Labs (FR)
Présentation de Django @ Orange Labs (FR)Présentation de Django @ Orange Labs (FR)
Présentation de Django @ Orange Labs (FR)
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
 
Vuex
VuexVuex
Vuex
 
Spring ioc
Spring iocSpring ioc
Spring ioc
 
Jenkins presentation
Jenkins presentationJenkins presentation
Jenkins presentation
 
JDBC: Gestion des bases de données en Java
JDBC: Gestion des bases de données en Java JDBC: Gestion des bases de données en Java
JDBC: Gestion des bases de données en Java
 
JEE_Chapter4_JSF_VF (1).pdf
JEE_Chapter4_JSF_VF (1).pdfJEE_Chapter4_JSF_VF (1).pdf
JEE_Chapter4_JSF_VF (1).pdf
 
Nouveautés Java 9-10-11
Nouveautés Java 9-10-11Nouveautés Java 9-10-11
Nouveautés Java 9-10-11
 
Difference between Java and c#
Difference between Java and c#Difference between Java and c#
Difference between Java and c#
 
Introduction JavaEE
Introduction JavaEEIntroduction JavaEE
Introduction JavaEE
 
Maven et industrialisation du logiciel
Maven et industrialisation du logicielMaven et industrialisation du logiciel
Maven et industrialisation du logiciel
 
Formation PHP
Formation PHPFormation PHP
Formation PHP
 
Java entreprise edition et industrialisation du génie logiciel par m.youssfi
Java entreprise edition et industrialisation du génie logiciel par m.youssfiJava entreprise edition et industrialisation du génie logiciel par m.youssfi
Java entreprise edition et industrialisation du génie logiciel par m.youssfi
 
Presentation Spring, Spring MVC
Presentation Spring, Spring MVCPresentation Spring, Spring MVC
Presentation Spring, Spring MVC
 
Introduction à Angular
Introduction à AngularIntroduction à Angular
Introduction à Angular
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
Docker Container Security
Docker Container SecurityDocker Container Security
Docker Container Security
 
Java DataBase Connectivity API (JDBC API)
Java DataBase Connectivity API (JDBC API)Java DataBase Connectivity API (JDBC API)
Java DataBase Connectivity API (JDBC API)
 

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

Mon application web en 20 minutes
Mon application web en 20 minutesMon application web en 20 minutes
Mon application web en 20 minutes
Open Source Experience
 
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
Andrey Karpov
 
Docker Starter Pack
Docker Starter PackDocker Starter Pack
Docker Starter Pack
Saeed Hajizade
 
Overview of CSharp MVC3 and EF4
Overview of CSharp MVC3 and EF4Overview of CSharp MVC3 and EF4
Overview of CSharp MVC3 and EF4
Rich Helton
 
Azure DevOps Extensions
Azure DevOps ExtensionsAzure DevOps Extensions
Azure DevOps Extensions
Christian 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 cloud
Fernando Lopez Aguilar
 
Microservices Server - MSS Workshop
Microservices Server - MSS WorkshopMicroservices Server - MSS Workshop
Microservices Server - MSS Workshop
WSO2
 
Workshop/Tutorial WSO2 Micro Services Server
Workshop/Tutorial WSO2 Micro Services ServerWorkshop/Tutorial WSO2 Micro Services Server
Workshop/Tutorial WSO2 Micro Services Server
Edgar 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 Java
Edgar Silva
 
Openshift cheat rhce_r3v1 rhce
Openshift cheat rhce_r3v1 rhceOpenshift cheat rhce_r3v1 rhce
Openshift cheat rhce_r3v1 rhce
Darnette 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 2008
Yudep Apoi
 
Cello Saas getting started
Cello Saas getting startedCello Saas getting started
Cello Saas getting started
kanimozhin
 
Refresh Austin - Intro to Dexy
Refresh Austin - Intro to DexyRefresh Austin - Intro to Dexy
Refresh Austin - Intro to Dexy
ananelson
 
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 4
Simone 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 Technology
Ajeet Singh Raina
 
Microservices in Java
Microservices in JavaMicroservices in Java
Microservices in Java
Anatole Tresch
 
Spring Live Sample Chapter
Spring Live Sample ChapterSpring Live Sample Chapter
Spring Live Sample ChapterSyed Shahul
 

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

More from 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-2022
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 2019
Laurent 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 2018
Laurent 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.0
Laurent Guérin
 
Sogeti labs developer-today-v1.1
Sogeti labs developer-today-v1.1Sogeti labs developer-today-v1.1
Sogeti labs developer-today-v1.1
Laurent 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.2
Laurent Guérin
 
Bean Validation - Cours v 1.1
Bean Validation - Cours v 1.1Bean Validation - Cours v 1.1
Bean Validation - Cours v 1.1
Laurent Guérin
 
Genie logiciel eseo-v1.1-1spp
Genie logiciel eseo-v1.1-1sppGenie logiciel eseo-v1.1-1spp
Genie logiciel eseo-v1.1-1spp
Laurent Guérin
 
Devoxx 2011 - Scaffolding with Telosys
Devoxx 2011 - Scaffolding with TelosysDevoxx 2011 - Scaffolding with Telosys
Devoxx 2011 - Scaffolding with Telosys
Laurent 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 Telosys
Laurent Guérin
 
Solutions Linux Développement Rapide Java
Solutions Linux Développement Rapide JavaSolutions Linux Développement Rapide Java
Solutions Linux Développement Rapide Java
Laurent Guérin
 

More from Laurent Guérin (12)

Microservices-DDD-Telosys-Devoxx-FR-2022
Microservices-DDD-Telosys-Devoxx-FR-2022Microservices-DDD-Telosys-Devoxx-FR-2022
Microservices-DDD-Telosys-Devoxx-FR-2022
 
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
 

Recently uploaded

GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
Sharepoint Designs
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
XfilesPro
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
NaapbooksPrivateLimi
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
KrzysztofKkol1
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 

Recently uploaded (20)

GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 

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…