Changes between Version 48 and Version 49 of S3/S3Model/ComponentResources


Ignore:
Timestamp:
02/07/14 10:50:29 (8 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3Model/ComponentResources

    v48 v49  
    7979
    8080{{{#!python
    81 s3db.add_components("org_organisation", org_office="organisation_id")
    82 }}}
    83 
    84 This assumes that the component alias is the same as the name of the component table without prefix, e.g. {{{tablename = "org_office" => component alias = "office"}}}. If you want set the alias explicitly, you can instead describe the join in a dict:
     81s3db.add_components("org_organisation",
     82                    org_office="organisation_id",
     83                   )
     84}}}
     85
     86This assumes that the component alias is the same as the name of the component table without prefix, e.g. {{{tablename = "org_office" => component alias = "office"}}}.
     87
     88If you want set the alias explicitly, you can instead describe the join in a dict:
    8589
    8690{{{#!python
     
    8892                    org_office={"name": "headquarter",       # the component alias
    8993                                "joinby": "organisation_id", # the foreign key
    90                                })
     94                               },
     95                   )
    9196}}}
    9297