Changes between Version 21 and Version 22 of DeveloperGuidelinesS3Framework


Ignore:
Timestamp:
05/20/09 20:54:54 (13 years ago)
Author:
Fran Boon
Comment:

No more modules=modules

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelinesS3Framework

    v21 v22  
    2020Each Controller should start like this (to populate the side navigation Menus):
    2121{{{
    22 module='module'
     22module = 'module'
    2323# 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)
     24module_name = db(db.module.name==module).select()[0].name_nice
    2725# 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)
     26options = db(db['%s_menu_option' % module].enabled=='Yes').select(db['%s_menu_option' % module].ALL, orderby=db['%s_menu_option' % module].priority)
    2927}}}
    3028
    3129Each 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)
    3331
    3432All tables which are user-editable need to be protected for conflict resolution & synchronization using the predefined fields {{{timestamp}}} & {{{uuidstamp}}}.[[BR]]
     
    3634{{{
    3735# Reusable timestamp fields
    38 timestamp=SQLTable(None,'timestamp',
     36timestamp = SQLTable(None,'timestamp',
    3937            db.Field('created_on','datetime',
    4038                          writable=False,
     
    4644# We need UUIDs as part of database synchronization
    4745import uuid
    48 uuidstamp=SQLTable(None,'uuidstamp',
     46uuidstamp = SQLTable(None,'uuidstamp',
    4947            db.Field('uuid',length=64,
    5048                          writable=False,