| 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 | | )) |
| | 55 | s3db.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 | )) |