4. Installation process
Wizard on Wiki to select correct instructions:
http://eden.sahanafoundation.org/wiki/InstallationGuidelines
Bootable USB
Windows
Developer Installer
Mac, Linux
Eden-Python-Installer-Dev.exe
Follow instructions to install from source
Virtual Machine
SahanaCamp Viet Nam
6. Editor / Debugger
Notepad+ good basic editor for Windows
+
Eclipse allows advanced debugging:
set breakpoints and step through code
http://eden.sahanafoundation.org/wiki/DeveloperGuidelinesEclipse
Firebug allows advanced debugging of CSS and
JavaScript
view AJAX requests
edit CSS in realtime
browse DOM
set breakpoints and step through code
SahanaCamp Viet Nam
23. Model View Controller
Each module will have:
Model: modules/s3db/modulename.py
Controller: controllers/modulename.py
Defines the data model
Links URLs to resources
Views: views/modulename/index.html
HTML templates with embedded python code
There may be additional view files for custom pages
SahanaCamp Viet Nam
24. Web2Py URL Mapping
http://host/application/controller/function
e.g.: http://127.0.0.1:8000/eden/default/index
Model: not
Controller: web2py/applications/eden/controllers/default.py
applicable here
Function: def
index():
View: web2py/applications/eden/views/default/index.html
SahanaCamp Viet Nam
25. Sahana Eden URL Mapping
http://host/eden/module/resource
eg: http://127.0.0.1:8000/eden/org/site
Model: web2py/applications/eden/modules/s3db/org.py
tablename = "org_site"
Controller: web2py/applications/eden/controllers/org.py
Function: def
site():
return s3_rest_controller()
View: not
applicable here
SahanaCamp Viet Nam
26. Views
HTML with Python inside {{..}}
Extend layout.html for basic look and feel
views/training/index.html
{{extend "layout.html"}}
<H1>Welcome to the Training Module</H1>
<A href='{{=URL(f="course")}}'>Browse the Course
List</A>
Resource Controllers use Generic Views:
web2py/applications/eden/views/_list_create.html
Can customise these in the template:
web2py/applications/eden/templates/template/views/_list_create.html
SahanaCamp Viet Nam
27. Edit a Field Label
modules/s3db/org.py
tablename = "org_organisation"
...
Field("donation_phone",
label = T("Donation Phone Number"),
SahanaCamp Viet Nam
33. Updating your Server
Commit code locally: git
Push to GitHub: git
Pull on Server: git
commit -a
push
pull
SahanaCamp Viet Nam
34. Sharing your Code
Commit code locally: git
Push to GitHub: git
commit -a
push
Submit Pull Request to get code merged into Trunk
SahanaCamp Viet Nam