Changes between Version 51 and Version 52 of DeveloperGuidelinesNewModule


Ignore:
Timestamp:
11/29/13 21:44:15 (11 years ago)
Author:
Pat Tressel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelinesNewModule

    v51 v52  
    2020}}}
    2121
    22 Add tables to modules/s3db/<MODULE NAME>.py file, as-required for your resources.
     22For each major "resource" in your module, add a class that is a subclass of S3Model. The class must define a model() method that defines the tables for that resource. The class can define multiple tables, for other resources associated with the major resource. For instance, if you have a major resource representing a vehicle, you might want a table to represent types of vehicles, so users can add new types without changing the code. The main table for specific vehicles and the table for types can go in the same model class.
     23
    2324To avoid namespace clashes, use your module name as a prefix for table names.
    24 Follow with underscore and the name of the resource your table represents: module_resource. Resource names should be unique.
     25Follow with underscore and the name of the resource your table represents: <MODULE NAME>_<RESOURCE>. Resource names should be unique.
    2526
    2627E.g. if building a Vehicle Management System, create s3db.vms_vehicle: