Changes between Version 33 and Version 34 of S3/S3Model/SuperEntities


Ignore:
Timestamp:
04/01/14 12:12:17 (11 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3Model/SuperEntities

    v33 v34  
    9696=== Linking to a Super-Entity ===
    9797
    98 Both, instance tables as well as shared components need to be linked to the super-entity. This can be done by inserting a ''super-key'' field into the instance/component table which must have the same name as the primary key of the super-entity. You can use the {{{super_link()}}} function as a DRY method for this:
     98Both, instance tables as well as shared components need to be linked to the super-entity.
    9999
    100 {{{
     100This can be done by inserting a ''super-key'' field into the instance/component table which must have the same name as the primary key of the super-entity. You can use the {{{super_link()}}} function to do this:
     101
     102{{{#!python
    101103tablename = "pr_presence"
    102104table = db.define_table(tablename,
     
    108110Note: {{{super_link}}} generates a {{{Field}}} instance - if you just need the name of the super-key field, you can use:
    109111
    110 {{{
     112{{{#!python
    111113sk = s3db.super_key(db.pr_pentity) # returns the string "pe_id"
    112114}}}
     115
     116...or just type the field name (best option in models with lazy tables).
    113117=== Updating a Super-Entity ===
    114118