Changes between Version 21 and Version 22 of DeveloperGuidelinesS3Framework
- Timestamp:
- 05/20/09 20:54:54 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DeveloperGuidelinesS3Framework
v21 v22 20 20 Each Controller should start like this (to populate the side navigation Menus): 21 21 {{{ 22 module ='module'22 module = 'module' 23 23 # Current Module (for sidebar title) 24 module_name=db(db.module.name==module).select()[0].name_nice 25 # List Modules (from which to build Menu of Modules) 26 modules=db(db.module.enabled=='Yes').select(db.module.ALL,orderby=db.module.menu_priority) 24 module_name = db(db.module.name==module).select()[0].name_nice 27 25 # List Options (from which to build Menu for this Module) 28 options =db(db['%s_menu_option' % module].enabled=='Yes').select(db['%s_menu_option' % module].ALL,orderby=db['%s_menu_option' % module].priority)26 options = db(db['%s_menu_option' % module].enabled=='Yes').select(db['%s_menu_option' % module].ALL, orderby=db['%s_menu_option' % module].priority) 29 27 }}} 30 28 31 29 Each function needs to return these values to the view: 32 return dict(module_name=module_name, modules=modules,options=options)30 return dict(module_name=module_name, options=options) 33 31 34 32 All tables which are user-editable need to be protected for conflict resolution & synchronization using the predefined fields {{{timestamp}}} & {{{uuidstamp}}}.[[BR]] … … 36 34 {{{ 37 35 # Reusable timestamp fields 38 timestamp =SQLTable(None,'timestamp',36 timestamp = SQLTable(None,'timestamp', 39 37 db.Field('created_on','datetime', 40 38 writable=False, … … 46 44 # We need UUIDs as part of database synchronization 47 45 import uuid 48 uuidstamp =SQLTable(None,'uuidstamp',46 uuidstamp = SQLTable(None,'uuidstamp', 49 47 db.Field('uuid',length=64, 50 48 writable=False,