Changes between Version 22 and Version 23 of S3/S3Model/ComponentResources


Ignore:
Timestamp:
08/07/12 07:47:47 (13 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3Model/ComponentResources

    v22 v23  
    5353
    5454{{{
    55 s3mgr.model.add_component("my_component",               # Tablename of the component
    56                           my_master=dict(               # Tablename of the master table
    57                               name="alias",             # Use this 'alias' as the component name
    58                               link="my_linktable",      # Tablename of the link table
    59                               joinby="fieldname",       # FK of the master table (=left key constraint)
    60                               key="fieldname",          # FK of the component table (=right key constraint)
    61                               actuate="replace",        # Actuation option (see above, optional, defaults to "link")
    62                               autodelete=False          # Delete the component record together with the last link (optional, default is False)
    63                               widget=Widget,            # Widget to use for embedding (optional, defaults to S3EmbedComponentWidget)
    64                               autocomplete="fieldname", # Field in the component to use for autocomplete when embedding the component
    65                           ))
     55s3db.add_component("my_component",               # Tablename of the component
     56                   my_master=dict(               # Tablename of the master table
     57                       name="alias",             # Use this 'alias' as the component name
     58                       link="my_linktable",      # Tablename of the link table
     59                       joinby="fieldname",       # FK of the master table (=left key constraint)
     60                       key="fieldname",          # FK of the component table (=right key constraint)
     61                       actuate="replace",        # Actuation option (see above, optional, defaults to "link")
     62                       autodelete=False          # Delete the component record together with the last link (optional, default is False)
     63                       widget=Widget,            # Widget to use for embedding (optional, defaults to S3EmbedComponentWidget)
     64                       autocomplete="fieldname", # Field in the component to use for autocomplete when embedding the component
     65                   ))
    6666                             
    6767}}}