Changes between Version 27 and Version 28 of S3/S3Model
- Timestamp:
- 01/27/14 11:45:33 (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
S3/S3Model
v27 v28 1 1 = S3Model = 2 2 [[TOC]] 3 4 See also:5 6 - [wiki:S3/S3Model/SuperEntities Super-Entities]7 3 8 4 == Purpose == … … 318 314 === Components === 319 315 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}}}). 316 Components are sub-tables of a master entity ("has"-relationship). 317 318 Components 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 323 current.s3db.add_component("org_office", org_organisation="organisation_id") 324 }}} 327 325 328 326 Read more here: [wiki:S3/S3Model/ComponentResources Component Resources] 329 327 328 ==== Super-Entities ==== 329 330 Super-entities are key tables spanning multiple entities. This allows references to multiple entities using a single foreign key. 331 332 S3Model provides a number of functions to define and manipulate super entities. 333 334 Read more here: [wiki:S3/S3Model/SuperEntities Super-Entities] 335 330 336 ---- 331 337