SlideShare une entreprise Scribd logo
1  sur  65
Télécharger pour lire hors ligne
Sahana Eden: Emergency Development Environment 15 September 2010, Grace Hopper Celebration Fran Boon [email_address]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Stack Overview ,[object Object],Client Browser Eclipse Firebug Sahana Eden (S3) Web2Py Python HTML JavaScript CSS
Installation: Virtual Machine ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Model-View-Controller ,[object Object],[object Object],[object Object],[object Object]
Model-View-Controller ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Model-View-Controller ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Modules ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Sahana Modules ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Request processing ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
eden module resource
Emergency ,[object Object]
Adding a new module ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Model: Define Table ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Controllers ,[object Object],[object Object],[object Object],[object Object]
Controller: S3 REST ,[object Object],[object Object],[object Object]
View ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
S3 REST Controller ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Models ,[object Object],[object Object],[object Object]
Models ,[object Object],[object Object],[object Object]
Core Models ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Core Models (continued) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Core Models (continued) ,[object Object],[object Object],[object Object],[object Object]
Views: S3 REST ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Views: Web2Py ,[object Object],[object Object],[object Object],[object Object],[object Object]
Views: Custom ,[object Object],[object Object],[object Object],[object Object],[object Object]
Views ,[object Object],[object Object],[object Object],[object Object],[object Object]
SQL constraints / Validators ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Field Types ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Default Values ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Labels ,[object Object],[object Object]
Internationalisation ,[object Object],[object Object]
Comments ,[object Object],[object Object]
CRUD Strings ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exploring: Web2Py shell ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Sahana Eden: Session 2 15 September 2010, Grace Hopper Celebration Fran Boon [email_address]
Branches LaunchPad Merge proposal Trunk Local Branch Your Branch bzr merge bzr push
URL(a= application , c= controller , f= function , args=[], vars={})
Enable Module ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Index page ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
View ,[object Object],[object Object],[object Object],[object Object],[object Object]
Controller: Menu ,[object Object],[object Object],[object Object]
DAL: Database Abstraction Layer ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DAL ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DAL ,[object Object],[object Object],[object Object]
Joined Resources ,[object Object],[object Object],[object Object],[object Object]
Joined Resources: Model ,[object Object],[object Object]
Joined Resources: Model ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Joined Resources: Model ,[object Object],[object Object],[object Object],[object Object],[object Object]
Joined Resources: Model ,[object Object],[object Object],[object Object],[object Object],[object Object]
Joined Resources: Controller ,[object Object],[object Object],[object Object],[object Object],[object Object]
Joined Resources: Model  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Joined Resources: Model ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Represent ,[object Object]
DAL: Optimised SQL queries ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
JR: Represent ,[object Object],[object Object]
Components ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
RHeader ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
RHeader Tabs ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
RHeader Tabs
End
S3 is built on Web2Py REST CRUD SQLFORM FORM
Documentation ,[object Object],[object Object],[object Object],[object Object]
Use the Source, Luke! ,[object Object]
Form submission ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Contenu connexe

Tendances

Feature flagging with rails engines
Feature flagging with rails enginesFeature flagging with rails engines
Feature flagging with rails enginesEnrico Teotti
 
Service approach for development REST API in Symfony2
Service approach for development REST API in Symfony2Service approach for development REST API in Symfony2
Service approach for development REST API in Symfony2Sumy PHP User Grpoup
 
Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2Sumy PHP User Grpoup
 
Workshop: Symfony2 Intruduction: (Controller, Routing, Model)
Workshop: Symfony2 Intruduction: (Controller, Routing, Model)Workshop: Symfony2 Intruduction: (Controller, Routing, Model)
Workshop: Symfony2 Intruduction: (Controller, Routing, Model)Antonio Peric-Mazar
 
ASP.NET MVC introduction
ASP.NET MVC introductionASP.NET MVC introduction
ASP.NET MVC introductionTomi Juhola
 
Rails 2.3 and Rack - NHRuby Feb 2009
Rails 2.3 and Rack - NHRuby Feb 2009Rails 2.3 and Rack - NHRuby Feb 2009
Rails 2.3 and Rack - NHRuby Feb 2009bturnbull
 
Workshop 13: AngularJS Parte II
Workshop 13: AngularJS Parte IIWorkshop 13: AngularJS Parte II
Workshop 13: AngularJS Parte IIVisual Engineering
 
Web components with Angular
Web components with AngularWeb components with Angular
Web components with AngularAna Cidre
 
Responsive Web Design e a Ubiquidade da Web
Responsive Web Design e a Ubiquidade da WebResponsive Web Design e a Ubiquidade da Web
Responsive Web Design e a Ubiquidade da WebEduardo Shiota Yasuda
 
Devoxx 09 (Belgium)
Devoxx 09 (Belgium)Devoxx 09 (Belgium)
Devoxx 09 (Belgium)Roger Kitain
 
Building Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJSBuilding Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJSAntonio Peric-Mazar
 
JSF 2.0 (JavaEE Webinar)
JSF 2.0 (JavaEE Webinar)JSF 2.0 (JavaEE Webinar)
JSF 2.0 (JavaEE Webinar)Roger Kitain
 
JSF Custom Components
JSF Custom ComponentsJSF Custom Components
JSF Custom ComponentsMichael Fons
 
Rails MVC by Sergiy Koshovyi
Rails MVC by Sergiy KoshovyiRails MVC by Sergiy Koshovyi
Rails MVC by Sergiy KoshovyiPivorak MeetUp
 
AngularJS vs. Ember.js vs. Backbone.js
AngularJS vs. Ember.js vs. Backbone.jsAngularJS vs. Ember.js vs. Backbone.js
AngularJS vs. Ember.js vs. Backbone.jsMark
 
Single Page Web Apps with Backbone.js and Rails
Single Page Web Apps with Backbone.js and RailsSingle Page Web Apps with Backbone.js and Rails
Single Page Web Apps with Backbone.js and RailsPrateek Dayal
 

Tendances (20)

Spring Surf 101
Spring Surf 101Spring Surf 101
Spring Surf 101
 
Feature flagging with rails engines
Feature flagging with rails enginesFeature flagging with rails engines
Feature flagging with rails engines
 
Service approach for development REST API in Symfony2
Service approach for development REST API in Symfony2Service approach for development REST API in Symfony2
Service approach for development REST API in Symfony2
 
Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2
 
实战Ecos
实战Ecos实战Ecos
实战Ecos
 
Workshop: Symfony2 Intruduction: (Controller, Routing, Model)
Workshop: Symfony2 Intruduction: (Controller, Routing, Model)Workshop: Symfony2 Intruduction: (Controller, Routing, Model)
Workshop: Symfony2 Intruduction: (Controller, Routing, Model)
 
ASP.NET MVC introduction
ASP.NET MVC introductionASP.NET MVC introduction
ASP.NET MVC introduction
 
Rails 2.3 and Rack - NHRuby Feb 2009
Rails 2.3 and Rack - NHRuby Feb 2009Rails 2.3 and Rack - NHRuby Feb 2009
Rails 2.3 and Rack - NHRuby Feb 2009
 
Workshop 13: AngularJS Parte II
Workshop 13: AngularJS Parte IIWorkshop 13: AngularJS Parte II
Workshop 13: AngularJS Parte II
 
Ember - introduction
Ember - introductionEmber - introduction
Ember - introduction
 
Web components with Angular
Web components with AngularWeb components with Angular
Web components with Angular
 
Responsive Web Design e a Ubiquidade da Web
Responsive Web Design e a Ubiquidade da WebResponsive Web Design e a Ubiquidade da Web
Responsive Web Design e a Ubiquidade da Web
 
Devoxx 09 (Belgium)
Devoxx 09 (Belgium)Devoxx 09 (Belgium)
Devoxx 09 (Belgium)
 
Building Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJSBuilding Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJS
 
Silex Cheat Sheet
Silex Cheat SheetSilex Cheat Sheet
Silex Cheat Sheet
 
JSF 2.0 (JavaEE Webinar)
JSF 2.0 (JavaEE Webinar)JSF 2.0 (JavaEE Webinar)
JSF 2.0 (JavaEE Webinar)
 
JSF Custom Components
JSF Custom ComponentsJSF Custom Components
JSF Custom Components
 
Rails MVC by Sergiy Koshovyi
Rails MVC by Sergiy KoshovyiRails MVC by Sergiy Koshovyi
Rails MVC by Sergiy Koshovyi
 
AngularJS vs. Ember.js vs. Backbone.js
AngularJS vs. Ember.js vs. Backbone.jsAngularJS vs. Ember.js vs. Backbone.js
AngularJS vs. Ember.js vs. Backbone.js
 
Single Page Web Apps with Backbone.js and Rails
Single Page Web Apps with Backbone.js and RailsSingle Page Web Apps with Backbone.js and Rails
Single Page Web Apps with Backbone.js and Rails
 

En vedette

Hallitusohjelmatavoitteet 2015 Vates-säätiö
Hallitusohjelmatavoitteet 2015 Vates-säätiöHallitusohjelmatavoitteet 2015 Vates-säätiö
Hallitusohjelmatavoitteet 2015 Vates-säätiöHarri Hietala
 
Mô hình static route
Mô hình static routeMô hình static route
Mô hình static routeshinibi
 
R05010302 E N G I N E E R I N G M E C H A N I C S
R05010302  E N G I N E E R I N G  M E C H A N I C SR05010302  E N G I N E E R I N G  M E C H A N I C S
R05010302 E N G I N E E R I N G M E C H A N I C Sguestd436758
 

En vedette (8)

Oferta iii trimestre
Oferta iii trimestreOferta iii trimestre
Oferta iii trimestre
 
Hallitusohjelmatavoitteet 2015 Vates-säätiö
Hallitusohjelmatavoitteet 2015 Vates-säätiöHallitusohjelmatavoitteet 2015 Vates-säätiö
Hallitusohjelmatavoitteet 2015 Vates-säätiö
 
Mô hình static route
Mô hình static routeMô hình static route
Mô hình static route
 
0007 ban
0007 ban0007 ban
0007 ban
 
Wedge 1 Retail Design 2011
Wedge 1 Retail Design 2011Wedge 1 Retail Design 2011
Wedge 1 Retail Design 2011
 
Uranium!!!!
Uranium!!!!Uranium!!!!
Uranium!!!!
 
R05010302 E N G I N E E R I N G M E C H A N I C S
R05010302  E N G I N E E R I N G  M E C H A N I C SR05010302  E N G I N E E R I N G  M E C H A N I C S
R05010302 E N G I N E E R I N G M E C H A N I C S
 
Social Customer Engagement. Toolset & How to Make a Plan.
Social Customer Engagement. Toolset & How to Make a Plan.Social Customer Engagement. Toolset & How to Make a Plan.
Social Customer Engagement. Toolset & How to Make a Plan.
 

Similaire à Sahana Eden: Track vehicles with new Vehicle module

Sahana Eden - Introduction to the Code
Sahana Eden - Introduction to the CodeSahana Eden - Introduction to the Code
Sahana Eden - Introduction to the CodeAidIQ
 
Sahana introduction to the code v2
Sahana   introduction to the code v2Sahana   introduction to the code v2
Sahana introduction to the code v2AidIQ
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Eliran Eliassy
 
Create an application with ember
Create an application with ember Create an application with ember
Create an application with ember Chandra Sekar
 
Boston Computing Review - Ruby on Rails
Boston Computing Review - Ruby on RailsBoston Computing Review - Ruby on Rails
Boston Computing Review - Ruby on RailsJohn Brunswick
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'sAntônio Roberto Silva
 
MVC & SQL_In_1_Hour
MVC & SQL_In_1_HourMVC & SQL_In_1_Hour
MVC & SQL_In_1_HourDilip Patel
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Phpfunkatron
 
Introduction to Alfresco Surf Platform
Introduction to Alfresco Surf PlatformIntroduction to Alfresco Surf Platform
Introduction to Alfresco Surf PlatformAlfresco Software
 
Useful Rails Plugins
Useful Rails PluginsUseful Rails Plugins
Useful Rails Pluginsnavjeet
 
Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...
Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...
Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...OdessaJS Conf
 
Exploring Symfony's Code
Exploring Symfony's CodeExploring Symfony's Code
Exploring Symfony's CodeWildan Maulana
 
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...King Foo
 
Rails 3 overview
Rails 3 overviewRails 3 overview
Rails 3 overviewYehuda Katz
 
Zend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_ToolZend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_ToolGordon Forsythe
 
Getting into ember.js
Getting into ember.jsGetting into ember.js
Getting into ember.jsreybango
 

Similaire à Sahana Eden: Track vehicles with new Vehicle module (20)

Sahana Eden - Introduction to the Code
Sahana Eden - Introduction to the CodeSahana Eden - Introduction to the Code
Sahana Eden - Introduction to the Code
 
Sahana introduction to the code v2
Sahana   introduction to the code v2Sahana   introduction to the code v2
Sahana introduction to the code v2
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics
 
Create an application with ember
Create an application with ember Create an application with ember
Create an application with ember
 
Nodejs.meetup
Nodejs.meetupNodejs.meetup
Nodejs.meetup
 
Boston Computing Review - Ruby on Rails
Boston Computing Review - Ruby on RailsBoston Computing Review - Ruby on Rails
Boston Computing Review - Ruby on Rails
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API's
 
Workshop 16: EmberJS Parte I
Workshop 16: EmberJS Parte IWorkshop 16: EmberJS Parte I
Workshop 16: EmberJS Parte I
 
PPT
PPTPPT
PPT
 
MVC & SQL_In_1_Hour
MVC & SQL_In_1_HourMVC & SQL_In_1_Hour
MVC & SQL_In_1_Hour
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Php
 
Introduction to Alfresco Surf Platform
Introduction to Alfresco Surf PlatformIntroduction to Alfresco Surf Platform
Introduction to Alfresco Surf Platform
 
Useful Rails Plugins
Useful Rails PluginsUseful Rails Plugins
Useful Rails Plugins
 
Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...
Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...
Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...
 
Exploring Symfony's Code
Exploring Symfony's CodeExploring Symfony's Code
Exploring Symfony's Code
 
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
Building Web Services with Zend Framework (PHP Benelux meeting 20100713 Vliss...
 
Rails 3 overview
Rails 3 overviewRails 3 overview
Rails 3 overview
 
Zend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_ToolZend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_Tool
 
Getting into ember.js
Getting into ember.jsGetting into ember.js
Getting into ember.js
 
CAF & Portlet Development Notes
CAF & Portlet Development NotesCAF & Portlet Development Notes
CAF & Portlet Development Notes
 

Plus de AidIQ

Tech 2 - Introduction to the Code
Tech 2 - Introduction to the CodeTech 2 - Introduction to the Code
Tech 2 - Introduction to the CodeAidIQ
 
Tech 1 - Deploying Sahana Eden
Tech 1  - Deploying Sahana EdenTech 1  - Deploying Sahana Eden
Tech 1 - Deploying Sahana EdenAidIQ
 
Introduction to Sahana Eden
Introduction to Sahana EdenIntroduction to Sahana Eden
Introduction to Sahana EdenAidIQ
 
Bombeiros Workshop - Introduction to Sahana Eden
Bombeiros Workshop - Introduction to Sahana EdenBombeiros Workshop - Introduction to Sahana Eden
Bombeiros Workshop - Introduction to Sahana EdenAidIQ
 
Sahana Open Source Humanitarian Software Project - Pandemic Preparedness Forum
Sahana Open Source Humanitarian Software Project - Pandemic Preparedness ForumSahana Open Source Humanitarian Software Project - Pandemic Preparedness Forum
Sahana Open Source Humanitarian Software Project - Pandemic Preparedness ForumAidIQ
 
Humanitarian Mapping - Sahana and OpenStreetMap
Humanitarian Mapping - Sahana and OpenStreetMapHumanitarian Mapping - Sahana and OpenStreetMap
Humanitarian Mapping - Sahana and OpenStreetMapAidIQ
 
Sahana Eden : Introduction and Simulation A (SahanaCamp 1.2)
Sahana Eden : Introduction and Simulation A (SahanaCamp 1.2)Sahana Eden : Introduction and Simulation A (SahanaCamp 1.2)
Sahana Eden : Introduction and Simulation A (SahanaCamp 1.2)AidIQ
 
Sahana Eden : Developer Environment (VM) (SahanaCamp 1.2)
Sahana Eden : Developer Environment (VM) (SahanaCamp 1.2)Sahana Eden : Developer Environment (VM) (SahanaCamp 1.2)
Sahana Eden : Developer Environment (VM) (SahanaCamp 1.2)AidIQ
 
Sahana Eden : Deployment (SahanaCamp 1.2)
Sahana Eden : Deployment (SahanaCamp 1.2)Sahana Eden : Deployment (SahanaCamp 1.2)
Sahana Eden : Deployment (SahanaCamp 1.2)AidIQ
 
Sahana Eden : Bug Reporting (SahanaCamp 1.2)
Sahana Eden : Bug Reporting (SahanaCamp 1.2)Sahana Eden : Bug Reporting (SahanaCamp 1.2)
Sahana Eden : Bug Reporting (SahanaCamp 1.2)AidIQ
 
Sahana : Case Studies (SahanaCamp 1.2)
Sahana : Case Studies (SahanaCamp 1.2)Sahana : Case Studies (SahanaCamp 1.2)
Sahana : Case Studies (SahanaCamp 1.2)AidIQ
 
Participatory programming
Participatory programmingParticipatory programming
Participatory programmingAidIQ
 
OpenStreetMap : Technical (SahanaCamp 1.2)
OpenStreetMap : Technical (SahanaCamp 1.2)OpenStreetMap : Technical (SahanaCamp 1.2)
OpenStreetMap : Technical (SahanaCamp 1.2)AidIQ
 
OpenStreetMap : Sahana Mapping Client (SahanaCamp 1.2)
OpenStreetMap : Sahana Mapping Client (SahanaCamp 1.2)OpenStreetMap : Sahana Mapping Client (SahanaCamp 1.2)
OpenStreetMap : Sahana Mapping Client (SahanaCamp 1.2)AidIQ
 
Simulation: Instructions ((SahanaCamp 1.2)
Simulation: Instructions ((SahanaCamp 1.2)Simulation: Instructions ((SahanaCamp 1.2)
Simulation: Instructions ((SahanaCamp 1.2)AidIQ
 
Simulation: Incidents (SahanaCamp 1.2)
Simulation: Incidents (SahanaCamp 1.2)Simulation: Incidents (SahanaCamp 1.2)
Simulation: Incidents (SahanaCamp 1.2)AidIQ
 
Implementing IT Solutions for Disaster Management (SahanaCamp 1.2)
Implementing IT Solutions for Disaster Management (SahanaCamp 1.2)Implementing IT Solutions for Disaster Management (SahanaCamp 1.2)
Implementing IT Solutions for Disaster Management (SahanaCamp 1.2)AidIQ
 
General Sessions Hand Outs (SahanaCamp 1.2)
General Sessions Hand Outs (SahanaCamp 1.2)General Sessions Hand Outs (SahanaCamp 1.2)
General Sessions Hand Outs (SahanaCamp 1.2)AidIQ
 
BZR & LaunchPad : Sharing Your Work With Others (SahanaCamp 1.2)
BZR & LaunchPad : Sharing Your Work With Others (SahanaCamp 1.2)BZR & LaunchPad : Sharing Your Work With Others (SahanaCamp 1.2)
BZR & LaunchPad : Sharing Your Work With Others (SahanaCamp 1.2)AidIQ
 
Sahana Eden : Introduction to the Code (SahanaCamp 1.2)
Sahana Eden : Introduction to the Code (SahanaCamp 1.2)Sahana Eden : Introduction to the Code (SahanaCamp 1.2)
Sahana Eden : Introduction to the Code (SahanaCamp 1.2)AidIQ
 

Plus de AidIQ (20)

Tech 2 - Introduction to the Code
Tech 2 - Introduction to the CodeTech 2 - Introduction to the Code
Tech 2 - Introduction to the Code
 
Tech 1 - Deploying Sahana Eden
Tech 1  - Deploying Sahana EdenTech 1  - Deploying Sahana Eden
Tech 1 - Deploying Sahana Eden
 
Introduction to Sahana Eden
Introduction to Sahana EdenIntroduction to Sahana Eden
Introduction to Sahana Eden
 
Bombeiros Workshop - Introduction to Sahana Eden
Bombeiros Workshop - Introduction to Sahana EdenBombeiros Workshop - Introduction to Sahana Eden
Bombeiros Workshop - Introduction to Sahana Eden
 
Sahana Open Source Humanitarian Software Project - Pandemic Preparedness Forum
Sahana Open Source Humanitarian Software Project - Pandemic Preparedness ForumSahana Open Source Humanitarian Software Project - Pandemic Preparedness Forum
Sahana Open Source Humanitarian Software Project - Pandemic Preparedness Forum
 
Humanitarian Mapping - Sahana and OpenStreetMap
Humanitarian Mapping - Sahana and OpenStreetMapHumanitarian Mapping - Sahana and OpenStreetMap
Humanitarian Mapping - Sahana and OpenStreetMap
 
Sahana Eden : Introduction and Simulation A (SahanaCamp 1.2)
Sahana Eden : Introduction and Simulation A (SahanaCamp 1.2)Sahana Eden : Introduction and Simulation A (SahanaCamp 1.2)
Sahana Eden : Introduction and Simulation A (SahanaCamp 1.2)
 
Sahana Eden : Developer Environment (VM) (SahanaCamp 1.2)
Sahana Eden : Developer Environment (VM) (SahanaCamp 1.2)Sahana Eden : Developer Environment (VM) (SahanaCamp 1.2)
Sahana Eden : Developer Environment (VM) (SahanaCamp 1.2)
 
Sahana Eden : Deployment (SahanaCamp 1.2)
Sahana Eden : Deployment (SahanaCamp 1.2)Sahana Eden : Deployment (SahanaCamp 1.2)
Sahana Eden : Deployment (SahanaCamp 1.2)
 
Sahana Eden : Bug Reporting (SahanaCamp 1.2)
Sahana Eden : Bug Reporting (SahanaCamp 1.2)Sahana Eden : Bug Reporting (SahanaCamp 1.2)
Sahana Eden : Bug Reporting (SahanaCamp 1.2)
 
Sahana : Case Studies (SahanaCamp 1.2)
Sahana : Case Studies (SahanaCamp 1.2)Sahana : Case Studies (SahanaCamp 1.2)
Sahana : Case Studies (SahanaCamp 1.2)
 
Participatory programming
Participatory programmingParticipatory programming
Participatory programming
 
OpenStreetMap : Technical (SahanaCamp 1.2)
OpenStreetMap : Technical (SahanaCamp 1.2)OpenStreetMap : Technical (SahanaCamp 1.2)
OpenStreetMap : Technical (SahanaCamp 1.2)
 
OpenStreetMap : Sahana Mapping Client (SahanaCamp 1.2)
OpenStreetMap : Sahana Mapping Client (SahanaCamp 1.2)OpenStreetMap : Sahana Mapping Client (SahanaCamp 1.2)
OpenStreetMap : Sahana Mapping Client (SahanaCamp 1.2)
 
Simulation: Instructions ((SahanaCamp 1.2)
Simulation: Instructions ((SahanaCamp 1.2)Simulation: Instructions ((SahanaCamp 1.2)
Simulation: Instructions ((SahanaCamp 1.2)
 
Simulation: Incidents (SahanaCamp 1.2)
Simulation: Incidents (SahanaCamp 1.2)Simulation: Incidents (SahanaCamp 1.2)
Simulation: Incidents (SahanaCamp 1.2)
 
Implementing IT Solutions for Disaster Management (SahanaCamp 1.2)
Implementing IT Solutions for Disaster Management (SahanaCamp 1.2)Implementing IT Solutions for Disaster Management (SahanaCamp 1.2)
Implementing IT Solutions for Disaster Management (SahanaCamp 1.2)
 
General Sessions Hand Outs (SahanaCamp 1.2)
General Sessions Hand Outs (SahanaCamp 1.2)General Sessions Hand Outs (SahanaCamp 1.2)
General Sessions Hand Outs (SahanaCamp 1.2)
 
BZR & LaunchPad : Sharing Your Work With Others (SahanaCamp 1.2)
BZR & LaunchPad : Sharing Your Work With Others (SahanaCamp 1.2)BZR & LaunchPad : Sharing Your Work With Others (SahanaCamp 1.2)
BZR & LaunchPad : Sharing Your Work With Others (SahanaCamp 1.2)
 
Sahana Eden : Introduction to the Code (SahanaCamp 1.2)
Sahana Eden : Introduction to the Code (SahanaCamp 1.2)Sahana Eden : Introduction to the Code (SahanaCamp 1.2)
Sahana Eden : Introduction to the Code (SahanaCamp 1.2)
 

Sahana Eden: Track vehicles with new Vehicle module

Notes de l'éditeur

  1. S3 is a codename for Sahana Eden Server & Client can be on the same machine Each part needs to be debugged separately: Eclipse works well for the Server-side Python, whilst Firebug is excellent for the generated HTML/CSS/JavaScript JavaScript libraries we use include jQuery & ExtJS
  2. There are notes on the Wiki for installing a developer environment on Windows, Mac or Linux machines if you wish to run in other environments later.
  3. Look around the filesystem in web2py/applications/eden folder Similar layout structure to other MVC frameworks, such as Ruby-on-Rails & Django
  4. JavaScript which doesn’t require server-side parsing put into static Python Libraries available: System Python, Web2Py, Eden (S3*)
  5. For each of these, you should find at least 1 Model, a single Controller & a folder containing 1 or more Views
  6. Minimise the time taken to process Manage dependencies No need to import most of the libraries in ‘gluon/’
  7. Sahana Eden is a Resource-centric application: Persons, Locations, etc
  8. Create a new file in the Models folder called ‘vts.py’ & type in the text above. Remember that whitespace matters! # Text after this symbol is a comment & is ignored If you make a mistake, then the Ticketing system should catch the error & let you know what you did wrong.
  9. No need to create a manual routes entry, unlike other frameworks, like Django
  10. Create a new file in the Controllers folder called ‘vts.py’ & type in the text above.
  11. Note that you’ll need to Register yourself as a user on the system before you’re allowed to create a resource. The 1 st user to register gets the Administrator role by default.
  12. Web Services, Mash-ups
  13. Minimise the time taken to process Manage dependencies No need to import most of the libraries in ‘gluon/’
  14. Deleted Columns / Tables simply Ignored
  15. Take a look at them now Remember that execution order is defined by alphabetical order
  16. Take a look at them now
  17. Take a look at them now
  18. These defaults are why we didn’t need any views for our application.
  19. No need to learn another macro language Can Extend just a single other file Can Include many others
  20. Create a new folder in the views folder called ‘vts’ & inside that put a new file ‘vehicle_list_create.html’. Type in the text above. Refresh the vehicle page to see the new text: http://127.0.0.1:8000/eden/vts/vehicle
  21. Open the About page & browse the variables We store our S3 variables in response.s3.*, session.s3.* so as not to pollute the Web2Py namespace
  22. unique=True is a SQL-level constraint. Open your vts.py from the models directory & add the extra code above. Validators are DAL-level constraints which produce nice error messages instead of tickets! Validators provide server-side validation & some also provide client-side rendering & validation Web2Py automatically adds a Validator when the SQL constraint is set.
  23. Fields default to type ‘string’. ‘ date’ is the SQL-level field type & also provides the class in the HTML which means we get a date widget Add the extra code above to your file & refresh the page, now enter a date.
  24. Add the extra code above to your file & refresh the page to see the default value
  25. Add this to your model (underneath the table definition) & try it out
  26. You can check out the languages file, if you wish: http://127.0.0.1:8000/admin/default/design/eden#languages Update all languages
  27. Add this to your model (underneath the table definition) & try it out Comment is rendered as ‘column3’ (although can be moved using ‘formstyle’) We also use the same space for Help buttons & ‘Add New Resource’ links. NB For optimal performance, we normally add such comments in the Controller instead & put them inside a ‘prep’ to tale effect just when ‘r.representation in shn_interactive_view_formats’
  28. Try them out…copy/paste from another controller & then edit…see what effect this has on your module.
  29. This should be available as a script or an alias ‘w2p’ iPython needs to be installed for object exploring.
  30. Normally you work in a local branch on your PC. You Merge changes in regularly from Trunk. You Push your changes to your branch on LaunchPad (You Pull from LaunchPad to update your server sites)
  31. URL() is an example of an HTML ‘Helper’ object Remember that after server-side Python finishes, we still have a lot of possibilities client-side with JavaScript.
  32. Add this text to the file 000_config.py in the models folder. Navigate to the home page to see the module appear both there & on the menu. Try navigating to the module. Module Type 10 means appears in the ‘more’ section of the default modules menu. (Most deployments will create a fully-customised menu anyway)
  33. Add this text to your controller file & now open the module. “ Custom View” is a Doc String One should be added to all functions for automatic documentation generators & interactive browsing of docs You can try this out in the Interactive Shell: w2p execfile("applications/eden/controllers/vts.py", globals()) help(index)
  34. Create a file called ‘index.html’ inside the views/vts folder See plain HTML being interspersed with the server-side parsed Python Look at another module’s index.html What’s bad about this index?
  35. Add this text to your controller (outside the functions – e.g. at the top) & see what effect this has on your module.
  36. Google: web2py dal Try these out in the Web2Py shell  Don’t take effect until you db.commit() Beware locking with Sqlite! (e.g. cron tasks) Wipe DB if developing a lot For Production, split Dev/UAT/Prod instances so that you can plan Data Migrations (Live migrations works in most cases, but some do need manual scripts still – not a complete ‘Get out of jail free’).
  37. Don’t take effect until you db.commit()
  38. Copt this text into your model. Note the use of string substitution to define the tablename
  39. Tells SQL that these fields are ‘reference’ fields (i.e. Foreign Keys) - They store integers which are a pointer to the ID field in the other tables.
  40. Copy this text into your Model & refresh the presence page Reusable field defined in models/03_gis.py Includes additional useful configuration such as .requires & .represent
  41. Copt this text into your controller. Try it out. Note the automation of the resource name to minimise the editing after copy/paste of new functions
  42. Copy this text into your model & see what it does for the page IS_ONE_OF() will provide us a dropdown showing license plates, even though we actually store the ID. This is an S3 validator which extends Web2Py’s IS_IN_DB() to support the ‘deleted’ status & also allow the use of lambdas as formatting options.
  43. We can add additional fields into the link table.
  44. IS_ONE_OF provides the representation in the dropdown table.field.represent provides the representation in Display/List views A lambda is a Python feature for defining anonymous functions on the fly: http://diveintopython.org/power_of_introspection/lambda_functions.html
  45. Optimise the query – we know we only want a single record & a single field from that record
  46. Add the optimised query to your model.
  47. Add this to your model underneath the definition of the Presence table & try out the URL. No need for dedicated presence() controller
  48. Add this Resource Header definition to your Controller. Be careful to get the end brackets & commas right! ‘ r’ is the resource
  49. Then plug it into the Controller
  50. Take a look at the HTML structure of the page in Firebug.
  51. Web2Py source code very accessible – small enough to be able to grasp the whole thing after not too long FORM defined in gluon/html.py: Dumb HTML elements SQLFORM defined in gluon/sqlhtml.py: Self-processing forms which update the database CRUD defined in gluon/tools.py: Wrappers around SQLFORM - We actually change CRUD a lot & are looking to remove it completely – building straight on top of SQLFORM() REST defined in modules/s3xrc.py: RESTful interface & XML representations If you drop down a level, then need to do things more manually & need to take care of framework issues yourself.
  52. Whilst we spend a lot of time updating developer documentation, the actual codebase always moves faster, so the source is always the most authoritative source of information.