Changes between Version 51 and Version 52 of S3/S3Model/ComponentResources


Ignore:
Timestamp:
02/07/14 10:55:14 (11 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3Model/ComponentResources

    v51 v52  
    7979
    8080{{{#!python
     81s3db.add_components("org_organisation",
     82                    # Component URL: /org/organisation/<id>/office
     83                    org_office="organisation_id",
     84                   )
     85}}}
     86
     87This 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"}}}.
     88
     89If you want set the alias explicitly, you can instead describe the join in a dict:
     90
     91{{{#!python
    8192s3db.add_components("org_organisation",
    82                     org_office="organisation_id",
    83                    )
    84 }}}
    85 
    86 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"}}}.
    87 
    88 If you want set the alias explicitly, you can instead describe the join in a dict:
    89 
    90 {{{#!python
    91 s3db.add_components("org_organisation",
     93                    # Component URL: /org/organisation/<id>/headquarter
    9294                    org_office={"name": "headquarter",       # the component alias
    9395                                "joinby": "organisation_id", # the foreign key