Changes between Version 36 and Version 37 of DeveloperGuidelinesNewModule


Ignore:
Timestamp:
06/09/10 21:00:51 (11 years ago)
Author:
Fran Boon
Comment:

Update for Modules defined in 01_modules.py & activated in 00_config.py

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelinesNewModule

    v36 v37  
    44Summary:
    55 * Copy an existing module, paste & edit.
    6  * You will need to delete the database in order to load the new model (del ...\sahana\databases\*.*.)
    76 * Good modules to look at to start with are or & cr as these are simplest & standard.
    87
    98=== Model ===
    10 Add module to db.s3_module:
    11  * http://127.0.0.1:8000/eden/appadmin/select/db?query=db.s3_module.id%3E0
     9Add module to {{{models/01_modules.py}}}
    1210
    13 This makes it visible on the front page & the left-hand navigation menu.
     11Activate it in {{{models/000_config.py}}}
    1412
    15 To make this change in code not just in this instance, then edit {{{/models/01_modules.py}}}:
    16 {{{
    17 # Populate table with Default modules
    18 if not len(db().select(table.ALL)):
    19     table.insert(
    20         name="veh",
    21         name_nice="Vehicle Management System",
    22         priority=<INSERT NEXT SEQUENTIAL PRIORITY HERE>,
    23         description="Allows the management of vehicles",
    24         enabled="True"
    25         )
    26 }}}
    27 
    28 You will need to delete the database in order to load the new model (del ...\eden\databases\*.*.)
     13This makes it visible on the front page & the menu.
    2914
    3015Create a file {{{/models/<MODULE NAME>.py}}}
     
    3722module = 'veh'
    3823resource = 'vehicle'
    39 
    40 # Current Module (for sidebar title)
    41 module_name = db(db.s3_module.name==module).select().first().name_nice
    4224
    4325tablename = module + '_' + resource
     
    7456{{{
    7557module = 'veh'
    76 # Current Module (for sidebar title)
    77 module_name = db(db.s3_module.name==module).select().first().name_nice
    7858
    7959# Options Menu (available in all Functions' Views)
     
    10383
    10484DeveloperGuidelines
    105 DeveloperGuidelines