Changes between Version 58 and Version 59 of DeveloperGuidelinesNewModule


Ignore:
Timestamp:
11/29/13 22:19:11 (11 years ago)
Author:
Pat Tressel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelinesNewModule

    v58 v59  
    103103Create a file: {{{/controllers/<MODULE NAME>.py}}}
    104104
    105 Add CRUD functions for your tables:
     105Add controller functions for your resources, and an index() function for your controller's landing page:
     106
    106107{{{
    107108module = request.controller
    108109
     110def index():
     111    """ Module Home Page """
     112
     113    module_name = settings.modules[module].name_nice
     114    response.title = module_name
     115
     116    return dict(module_name=module_name)
     117
    109118def vehicle():
    110     "RESTful CRUD controller"
     119    """ RESTful CRUD controller """
     120
    111121    resource = request.function
    112122    return s3_rest_controller(module, resource)