Changes between Version 43 and Version 44 of DeveloperGuidelinesNewModule


Ignore:
Timestamp:
07/03/13 12:28:17 (12 years ago)
Author:
hardik juneja
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelinesNewModule

    v43 v44  
    22
    33== 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.
    77
    88=== Model ===
    9 Add your module to {{{models/000_config.py}}}
    10 
     9Add your module to {{{private/templates/<template>/config.py}}}[[BR]]
     10Also, Add It too {{{models/tables.py}}}[[BR]]
    1111This makes it visible on the front page & the menu.
    1212
    13 Create a file {{{/models/<MODULE NAME>.py}}}
     13Create a file {{{modules/s3db/<MODULE NAME>.py}}}
    1414
    1515Add tables to this file, as-required for your resources.[[BR]]
    16 To avoid namespace clashes, use the format: {{{db.module_table}}}
     16To avoid namespace clashes, use the format: {{{s3db.module_table}}}
    1717
    18 e.g. if building a Vehicle Management System, create db.vts_vehicle:
     18e.g. if building a Vehicle Management System, create s3db.vts_vehicle:
    1919{{{
    20 module = "vts"
    21 resource = "vehicle"
     20module = "org"
     21resource = "organisation"
    2222
    2323tablename = "%s_%s" % (module, resource)
    24 table = db.define_table(tablename,
     24table = s3db.define_table(tablename,
    2525                Field("name"),
    2626                *s3_meta_fields())