Changes between Version 4 and Version 5 of DeveloperGuidelines/Tutorial
- Timestamp:
- 01/17/13 22:18:42 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DeveloperGuidelines/Tutorial
v4 v5 3 3 = Tutorial = 4 4 5 The following material from [wiki:SahanaCamp/1.2 SahanaCamp 1.2] may be useful: 6 * [http://eden.sahanafoundation.org/attachment/wiki/SahanaCamp/1.2/Sahana%20Eden%20-%20Developer%20Environment%20(VM).pdf Sahana Eden - Developer Environment (VM)] 7 * [http://eden.sahanafoundation.org/attachment/wiki/SahanaCamp/1.2/Sahana%20Eden%20-%20Introduction%20to%20the%20Code.pdf Sahana Eden - Introduction to the Code] 8 * [http://eden.sahanafoundation.org/attachment/wiki/SahanaCamp/1.2/Sahana%20Eden%20-%20Bug%20Reporting.pdf Sahana Eden - Bug Reporting] 9 * [http://eden.sahanafoundation.org/attachment/wiki/SahanaCamp/1.2/Sahana%20Eden%20-%20Localisation.pdf Sahana Eden - Localisation] 10 * [wiki:DeveloperQuickstart] 5 == Sahana Eden Essential Guide == 6 Have a look at the [wiki:Book Sahana Eden Essential Guide Book] and follow the tutorial chapters: 7 * [http://en.flossmanuals.net/sahana-eden/customisation/ Customisation] 8 * [http://en.flossmanuals.net/sahana-eden/building-a-new-application/ Building a New Module] 11 9 12 10 == Python == 13 11 DeveloperGuidelines#Python 14 12 13 === MVC Architecture === 15 14 == Model == 16 Defines databases in: {{{/mod els/module.py}}}15 Defines databases in: {{{/modules/models/*}}} 17 16 18 17 The Models are loaded 1st within Web2Py processing, before the controllers.[[BR]] … … 20 19 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 21 20 21 == View == 22 HTML/Javascript templates in {{{/views/*}}} 23 * these are normal HTML/JS files with the ability to add in Python code (e.g. variables) surrounded by brackets: {{ interpreted python here }} 24 * there should be an .html file available for each function in the module (name normally being the same as the function) 25 * these normally inherit from {{{views/layout.html}}} which also includes the !JavaScript from {{{views/*_ajax.html}}} 26 * 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 27 22 28 == Controller == 23 Python functions in {{{/controllers/ module.py}}} [[BR]]29 Python functions in {{{/controllers/*}}} [[BR]] 24 30 e.g. 25 31 {{{ … … 29 35 }}} 30 36 31 == View ==32 HTML/Javascript templates in {{{/views/module/function.html}}}33 * these are normal HTML/JS files with the ability to add in Python code (e.g. variables) surrounded by brackets: {{ interpreted python here }}34 * there should be an .html file available for each function in the module (name normally being the same as the function)35 * these normally inherit from {{{views/layout.html}}} which also includes the !JavaScript from {{{views/*_ajax.html}}}36 * 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 nicely37 38 37 Static CSS/Javascript files are stored in {{{/static}}}