Changes between Version 109 and Version 110 of DeveloperGuidelines
- Timestamp:
- 07/21/10 09:14:50 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DeveloperGuidelines
v109 v110 1 1 [[TOC]] 2 2 = Developer Guide = 3 == = Install a Development Environment ===3 == Install a Development Environment == 4 4 - see [wiki:InstallationGuidelinesDeveloper] 5 5 6 == = Python ===6 == Python == 7 7 Indentation matters (use 4 spaces instead of Tabs) 8 8 * http://diveintopython.org/ … … 14 14 More details at: DeveloperGuidelinesCodeConventions 15 15 16 == = Web2Py ===16 == Web2Py == 17 17 This is an [http://en.wikipedia.org/wiki/Model-view-controller MVC] environment (like [http://web2py.com/AlterEgo/default/show/103 Rails] & [http://web2py.com/AlterEgo/default/show/101 Django]. [http://vimeo.com/6507384 Django polls turorial conversion course]). 18 18 … … 27 27 28 28 Web2Py can be extended through [http://www.web2py.com/plugins Plugins] & also has a [http://web2pyslices.com recipes site]. 29 ==== Model ==== 29 30 == Tutorial == 31 This tutorial was given at !SahanaCamp in Delhi: 32 * http://www.slideshare.net/AidIQ/sahana-eden-introduction-to-the-code 33 34 === Model === 30 35 Defines databases in: {{{/models/module.py}}} 31 36 … … 34 39 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 35 40 36 === = Controller ====41 === Controller === 37 42 Python functions in {{{/controllers/module.py}}} [[BR]] 38 43 e.g. … … 43 48 }}} 44 49 45 === = View ====50 === View === 46 51 HTML/Javascript templates in {{{/views/module/function.html}}} 47 52 * these are normal HTML/JS files with the ability to add in Python code (e.g. variables) surrounded by brackets: {{ interpreted python here }} … … 52 57 Static CSS/Javascript files are stored in {{{/static}}} 53 58 54 == = Javascript ===59 == Javascript == 55 60 * jQuery is used for client-side business logic (hiding fields, opening up tabs, etc): 56 61 * Tutorial 1: http://docs.jquery.com/Tutorials:How_jQuery_Works … … 67 72 * W3Schools' basic JS: http://www.w3schools.com/js/ 68 73 69 === Reserved Keywords ===70 * 'request' -> web2py internal use71 * 'key' as a db row name -> MySQL confuses it with internal keyword KEY72 * http://dev.mysql.com/doc/mysqld-version-reference/en/mysqld-version-reference-reservedwords-5-0.html73 * http://www.postgresql.org/docs/8.1/static/sql-keywords-appendix.html74 75 74 == Developer Guidelines == 76 77 * WSGI likes print statements to go to {{{sys.stderr}}} not {{{sys.stdout}}}: http://code.google.com/p/modwsgi/wiki/DebuggingTechniques78 75 79 76 * [wiki:DeveloperGuidelinesS3Framework Sahana Eden Framework: S3]