Changes between Version 12 and Version 13 of S3/DynamicTables


Ignore:
Timestamp:
02/22/17 11:28:57 (5 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/DynamicTables

    v12 v13  
    8383||component_key||boolean||default False||indicates that this field is a foreign key to link to the master table (see dynamic components), field must be a reference||
    8484||component_alias||string||no||the alias to access the table as component||
     85||component_tab||boolean||default False||expose the component on a tab||
     86
    8587=== Managing dynamic models through the web UI ===
    8688
     
    212214GET http://localhost:8000/eden/org/organisation/8/rating
    213215}}}
     216
     217=== Exposing Dynamic Components on Tabs ===
     218
     219To expose a dynamic component as a tab in the master record perspective, set component_tab=True for the component key:
     220
     221{{{#!python
     222    # Component key
     223    {"name": "organisation_id",
     224     "field_type": "reference org_organisation",
     225     "component_key": True,
     226     "component_alias": "rating",
     227
     228     # Expose a component tab:
     229     "component_tab": True,
     230
     231     },
     232}}}
     233
     234The component alias will be used to generate a tab label. To override this, configure a {{{tab_label}}} in the field settings:
     235
     236{{{#!python
     237    # Component key
     238    {"name": "organisation_id",
     239     "field_type": "reference org_organisation",
     240     "component_key": True,
     241     "component_alias": "rating",
     242     "component_tab": True,
     243
     244     # Field settings to control the component tab:
     245     "settings": {
     246        "tab_label": "Performance Ratings",
     247        },
     248     },
     249}}}
     250
     251The tab will be appended to the existing component tabs. To determine a tab position add a {{{tab_position}}} setting:
     252
     253{{{#!python
     254    # Component key
     255    {"name": "organisation_id",
     256     "field_type": "reference org_organisation",
     257     "component_key": True,
     258     "component_alias": "rating",
     259     "component_tab": True,
     260
     261     # Field settings to control the component tab:
     262     "settings": {
     263        "tab_label": "Performance Ratings",
     264        "tab_position": 2,
     265        },
     266     },
     267}}}
     268