Changes between Version 33 and Version 34 of DeveloperGuidelinesNewModule


Ignore:
Timestamp:
05/24/10 06:58:35 (12 years ago)
Author:
Fran Boon
Comment:

Update to current stds

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelinesNewModule

    v33 v34  
    1313This makes it visible on the front page & the left-hand navigation menu.
    1414
    15 To make this change in code not just in this instance, then edit {{{/models/01_module.py}}}:
     15To make this change in code not just in this instance, then edit {{{/models/01_modules.py}}}:
    1616{{{
    1717# Populate table with Default modules
    18 if not len(db().select(db[table].ALL)):
    19     db[table].insert(
     18if not len(db().select(table.ALL)):
     19    table.insert(
    2020        name="veh",
    2121        name_nice="Vehicle Management System",
    2222        priority=<INSERT NEXT SEQUENTIAL PRIORITY HERE>,
    2323        description="Allows the management of vehicles",
    24         enabled='True'
     24        enabled="True"
    2525        )
    2626}}}
     
    4141module_name = db(db.s3_module.name==module).select().first().name_nice
    4242
    43 table = module + '_' + resource
    44 db.define_table(table, timestamp, uuidstamp,
    45                 db.Field('name'))
    46 db[table].uuid.requires = IS_NOT_IN_DB(db, '%s.uuid' % table)
    47 db.veh_vehicle.name.requires = IS_NOT_EMPTY()
    48 db.veh_vehicle.name.comment = SPAN("*", _class="req")
     43tablename = module + '_' + resource
     44table = db.define_table(tablename, timestamp, uuidstamp,
     45                Field('name'))
     46table.uuid.requires = IS_NOT_IN_DB(db, '%s.uuid' % table)
     47table.name.requires = IS_NOT_EMPTY()
     48table.name.comment = SPAN("*", _class="req")
    4949}}}
    5050
    5151Add the messages for your resources:
    5252{{{
    53 title_create = T('Add Vehicle')
    54 title_display = T('Vehicle Details')
    55 title_list = T('List Vehicles')
    56 title_update = T('Edit Vehicle')
    57 title_search = T('Search Vehicles')
    58 subtitle_create = T('Add New Vehicle')
    59 subtitle_list = T('Vehicles')
    60 label_list_button = T('List Vehicles')
    61 label_create_button = T('Add Vehicle')
    62 msg_record_created = T('Vehicle added')
    63 msg_record_modified = T('Vehicle updated')
    64 msg_record_deleted = T('Vehicle deleted')
    65 msg_list_empty = T('No Vehicles currently registered')
    66 crud_strings[table] = Storage(title_create=title_create, title_display=title_display, title_list=title_list, title_update=title_update, subtitle_create=subtitle_create, subtitle_list=subtitle_list, label_list_button=label_list_button, label_create_button=label_create_button, msg_record_created=msg_record_created, msg_record_modified=msg_record_modified, msg_record_deleted=msg_record_deleted, msg_list_empty=msg_list_empty)
     53s3.crud_strings[table] = Storage(
     54    title_create = T('Add Vehicle')
     55    title_display = T('Vehicle Details')
     56    title_list = T('List Vehicles')
     57    title_update = T('Edit Vehicle')
     58    title_search = T('Search Vehicles')
     59    subtitle_create = T('Add New Vehicle')
     60    subtitle_list = T('Vehicles')
     61    label_list_button = T('List Vehicles')
     62    label_create_button = T('Add Vehicle')
     63    label_delete_button = T('Delete Vehicle')
     64    msg_record_created = T('Vehicle added')
     65    msg_record_modified = T('Vehicle updated')
     66    msg_record_deleted = T('Vehicle deleted')
     67    msg_list_empty = T('No Vehicles currently registered'))
    6768}}}
    6869