Changes between Version 27 and Version 28 of S3/S3Model


Ignore:
Timestamp:
01/27/14 11:45:33 (8 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3Model

    v27 v28  
    11= S3Model =
    22[[TOC]]
    3 
    4 See also:
    5 
    6   - [wiki:S3/S3Model/SuperEntities Super-Entities]
    73
    84== Purpose ==
     
    318314=== Components ===
    319315
    320 Components can be defined in S3Models using the {{{add_component}}} method:
    321 
    322 {{{
    323 current.s3db.add_component(<component_table_name>, <master_table_name>=<join>)
    324 }}}
    325 
    326 The {{{add_component()}}} method is available both in {{{S3Model}}} instances ({{{self.add_component}}}, {{{s3db.add_component}}}) as well as from the class ({{{S3Model.add_component}}}).
     316Components are sub-tables of a master entity ("has"-relationship).
     317
     318Components can be defined in S3Models using the {{{add_component}}} method, e.g.
     319
     320{{{#!python
     321# Offices (org_office table) are a component of organisations (org_organisation table),
     322# linked through the organisation_id field in org_office
     323current.s3db.add_component("org_office", org_organisation="organisation_id")
     324}}}
    327325
    328326Read more here: [wiki:S3/S3Model/ComponentResources Component Resources]
    329327
     328==== Super-Entities ====
     329
     330Super-entities are key tables spanning multiple entities. This allows references to multiple entities using a single foreign key.
     331
     332S3Model provides a number of functions to define and manipulate super entities.
     333
     334Read more here: [wiki:S3/S3Model/SuperEntities Super-Entities]
     335
    330336----
    331337