[[TOC]] = Tutorial = The following material from SahanaCamp1.2 may be useful: * [http://eden.sahanafoundation.org/attachment/wiki/SahanaCamp1.2/Sahana%20Eden%20-%20Developer%20Environment%20(VM).pdf Sahana Eden - Developer Environment (VM)] * [http://eden.sahanafoundation.org/attachment/wiki/SahanaCamp1.2/Sahana%20Eden%20-%20Introduction%20to%20the%20Code.pdf Sahana Eden - Introduction to the Code] * [http://eden.sahanafoundation.org/attachment/wiki/SahanaCamp1.2/Sahana%20Eden%20-%20Bug%20Reporting.pdf Sahana Eden - Bug Reporting] * [http://eden.sahanafoundation.org/attachment/wiki/SahanaCamp1.2/Sahana%20Eden%20-%20Localisation.pdf Sahana Eden - Localisation] * [wiki:DeveloperQuickstart] == Model == Defines databases in: {{{/models/module.py}}} The Models are loaded 1st within Web2Py processing, before the controllers.[[BR]] So you can import any global modules/set any global variables here.[[BR]] The Models are imported in alphabetical order, so we load the files which other modules depend on 1st, hence naming them appropriately:[[BR]]{{{000_config.py}}}, {{{01_crud.py}}}, {{{02_pr.py}}}, {{{03_gis.py}}}, etc == Controller == Python functions in {{{/controllers/module.py}}} [[BR]] e.g. {{{ def list_records(): items = crud.select(table) return dict(items=items) }}} == View == HTML/Javascript templates in {{{/views/module/function.html}}} * these are normal HTML/JS files with the ability to add in Python code (e.g. variables) surrounded by brackets: {{ interpreted python here }} * there should be an .html file available for each function in the module (name normally being the same as the function) * these normally inherit from {{{views/layout.html}}} which also includes the !JavaScript from {{{views/*_ajax.html}}} * if there is no view defined then a default view will be displayed, which will show the values of all the data it can see, but not be formatted nicely Static CSS/Javascript files are stored in {{{/static}}}