-
Notifications
You must be signed in to change notification settings - Fork 36
RelationshipOneToMany
Carlo Barazzetta edited this page Jan 27, 2017
·
2 revisions
Please refer to here for general information about models.
If you define a "Has Many" reference between models, you are creating a Master/Detail relationship. You have to operate in both master and detail models:
- Master model: define the
DetailReferences
node listing detail references - Detail model: define a reference field that points back to the master model.
Example from HelloKitto:
# model Party.yaml
ModelName: Party
...
DetailReferences:
Invitations: Invitation
# model Invitation.yaml
ModelName: Invitation
Fields:
...
Party: Reference(Party) not null
Fields:
Party_Id:
In order to render the master/detail relationship between data, you have to define the MainTable/DetailTables
node in the view as following:
# view parties
Type: Data
...
MainTable:
Model: Party
.......
DetailTables:
Controller:
# Tabs/Popup/Bottom. Default = Tabs.
Style: Bottom
Height: 250
Table:
Model: Invitation
Fields:
Invitation_Id:
Party:
IsVisible: False
Invitee:
Accepted:
- Kitto at a glance
- Getting started
- Setup
-
Basic concepts
- Basic Materials
- Controllers
- Features
- Kitto Enterprise
- Examples
- Developer's guide
- Library reference
- Frequently Asked Questions
- Kitto tips & tricks and how-tos
- Other information