Changes between Version 43 and Version 44 of DeveloperGuidelinesNewModule
- Timestamp:
- 07/03/13 12:28:17 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DeveloperGuidelinesNewModule
v43 v44 2 2 3 3 == How to add a new module? == 4 Summary: 5 * Copy an existing module, paste & edit.6 * Good modules to look at to start with are or & cr as these are simplest & standard.4 5 * First, try Following the steps given [http://en.flossmanuals.net/sahana-eden/building-a-new-application Here] 6 * Then, try making following changes. 7 7 8 8 === Model === 9 Add your module to {{{ models/000_config.py}}}10 9 Add your module to {{{private/templates/<template>/config.py}}}[[BR]] 10 Also, Add It too {{{models/tables.py}}}[[BR]] 11 11 This makes it visible on the front page & the menu. 12 12 13 Create a file {{{ /models/<MODULE NAME>.py}}}13 Create a file {{{modules/s3db/<MODULE NAME>.py}}} 14 14 15 15 Add tables to this file, as-required for your resources.[[BR]] 16 To avoid namespace clashes, use the format: {{{ db.module_table}}}16 To avoid namespace clashes, use the format: {{{s3db.module_table}}} 17 17 18 e.g. if building a Vehicle Management System, create db.vts_vehicle:18 e.g. if building a Vehicle Management System, create s3db.vts_vehicle: 19 19 {{{ 20 module = " vts"21 resource = " vehicle"20 module = "org" 21 resource = "organisation" 22 22 23 23 tablename = "%s_%s" % (module, resource) 24 table = db.define_table(tablename,24 table = s3db.define_table(tablename, 25 25 Field("name"), 26 26 *s3_meta_fields())