Name
Project-employee assignment

Description
Example of building interfaces based on many to many relationships

Pack
{
  "pages": [],
  "views": [
    {
      "name": "ShowProject",
      "table": "Projects",
      "min_role": 1,
      "on_root_page": false,
      "viewtemplate": "Show",
      "configuration": {
        "layout": {
          "above": [
            {
              "widths": [
                2,
                10
              ],
              "besides": [
                {
                  "above": [
                    null,
                    {
                      "type": "blank",
                      "contents": "Name"
                    }
                  ]
                },
                {
                  "above": [
                    null,
                    {
                      "type": "field",
                      "fieldview": "as_text",
                      "field_name": "name"
                    }
                  ]
                }
              ]
            },
            {
              "type": "line_break"
            },
            {
              "widths": [
                2,
                10
              ],
              "besides": [
                {
                  "above": [
                    null,
                    {
                      "type": "blank",
                      "contents": "Value"
                    }
                  ]
                },
                {
                  "above": [
                    null,
                    {
                      "type": "field",
                      "fieldview": "show",
                      "field_name": "value"
                    }
                  ]
                }
              ]
            },
            {
              "type": "line_break"
            }
          ]
        },
        "columns": [
          {
            "type": "Field",
            "fieldview": "as_text",
            "field_name": "name"
          },
          {
            "type": "Field",
            "fieldview": "show",
            "field_name": "value"
          }
        ],
        "viewname": "ShowProject"
      }
    },
    {
      "name": "ShowStaff",
      "table": "Staff",
      "min_role": 1,
      "on_root_page": false,
      "viewtemplate": "Show",
      "configuration": {
        "layout": {
          "above": [
            {
              "widths": [
                2,
                10
              ],
              "besides": [
                {
                  "above": [
                    null,
                    {
                      "type": "blank",
                      "contents": "Name"
                    }
                  ]
                },
                {
                  "above": [
                    null,
                    {
                      "type": "field",
                      "fieldview": "as_text",
                      "field_name": "name"
                    }
                  ]
                }
              ]
            },
            {
              "type": "line_break"
            },
            {
              "widths": [
                2,
                10
              ],
              "besides": [
                {
                  "above": [
                    null,
                    {
                      "type": "blank",
                      "contents": "Salary"
                    }
                  ]
                },
                {
                  "above": [
                    null,
                    {
                      "type": "field",
                      "fieldview": "show",
                      "field_name": "salary"
                    }
                  ]
                }
              ]
            },
            {
              "type": "line_break"
            },
            {
              "widths": [
                2,
                10
              ],
              "besides": [
                {
                  "type": "blank",
                  "contents": "Contracts value"
                },
                null
              ]
            }
          ]
        },
        "columns": [
          {
            "type": "Field",
            "fieldview": "as_text",
            "field_name": "name"
          },
          {
            "type": "Field",
            "fieldview": "show",
            "field_name": "salary"
          }
        ],
        "viewname": "ShowStaff"
      }
    },
    {
      "name": "EditProjectStaff",
      "table": "ProjectStaff",
      "min_role": 1,
      "on_root_page": false,
      "viewtemplate": "Edit",
      "configuration": {
        "layout": {
          "above": [
            {
              "widths": [
                2,
                10
              ],
              "besides": [
                {
                  "above": [
                    null,
                    {
                      "type": "blank",
                      "contents": "Staff"
                    }
                  ]
                },
                {
                  "above": [
                    null,
                    {
                      "type": "field",
                      "fieldview": "select",
                      "field_name": "staff"
                    }
                  ]
                }
              ]
            },
            {
              "type": "line_break"
            },
            {
              "widths": [
                2,
                10
              ],
              "besides": [
                {
                  "above": [
                    null,
                    {
                      "type": "blank",
                      "contents": "Project"
                    }
                  ]
                },
                {
                  "above": [
                    null,
                    {
                      "type": "field",
                      "fieldview": "select",
                      "field_name": "project"
                    }
                  ]
                }
              ]
            },
            {
              "type": "line_break"
            },
            {
              "type": "action",
              "minRole": 10,
              "action_name": "Save"
            }
          ]
        },
        "columns": [
          {
            "type": "Field",
            "fieldview": "select",
            "field_name": "staff"
          },
          {
            "type": "Field",
            "fieldview": "select",
            "field_name": "project"
          },
          {
            "type": "Action",
            "minRole": 10,
            "action_name": "Save"
          }
        ],
        "viewname": "EditProjectStaff",
        "view_when_done": "Projects"
      }
    },
    {
      "name": "ProjectList",
      "table": "Projects",
      "min_role": 10,
      "on_root_page": true,
      "viewtemplate": "List",
      "configuration": {
        "layout": {
          "above": [
            null,
            {
              "widths": [
                2,
                10
              ],
              "besides": [
                {
                  "above": [
                    null,
                    {
                      "type": "blank",
                      "block": false,
                      "contents": "Name",
                      "textStyle": ""
                    }
                  ]
                },
                {
                  "above": [
                    null,
                    {
                      "type": "field",
                      "block": false,
                      "fieldview": "as_text",
                      "textStyle": "",
                      "field_name": "name"
                    }
                  ]
                }
              ]
            },
            {
              "type": "line_break"
            },
            {
              "widths": [
                2,
                10
              ],
              "besides": [
                {
                  "above": [
                    null,
                    {
                      "type": "blank",
                      "block": false,
                      "contents": "Value",
                      "textStyle": ""
                    }
                  ]
                },
                {
                  "above": [
                    null,
                    {
                      "type": "field",
                      "block": false,
                      "fieldview": "show",
                      "textStyle": "",
                      "field_name": "value"
                    }
                  ]
                }
              ]
            },
            {
              "type": "line_break"
            }
          ]
        },
        "columns": [
          {
            "stat": "Count",
            "type": "Field",
            "view": "Own:ShowProject",
            "agg_field": "staff",
            "fieldview": "as_text",
            "field_name": "name",
            "join_field": "",
            "view_label": "",
            "action_name": "Delete",
            "state_field": "on",
            "action_label": "",
            "agg_relation": "ProjectStaff.project"
          }
        ],
        "viewname": "ProjectList",
        "default_state": {
          "name": ""
        },
        "view_to_create": "",
        "create_view_label": "",
        "create_view_display": "Link"
      }
    },
    {
      "name": "Projects",
      "table": "Projects",
      "min_role": 1,
      "menu_label": "Projects",
      "on_root_page": false,
      "viewtemplate": "ListShowList",
      "configuration": {
        "viewname": "Projects",
        "list_view": "ProjectList",
        "show_view": "ShowProject",
        "subtables": {
          "ChildList:ProjectsStaffList.ProjectStaff.project": true,
          "ChildList:StaffsProjectsList.ProjectStaff.project": false
        }
      }
    },
    {
      "name": "StaffList",
      "table": "Staff",
      "min_role": 1,
      "on_root_page": false,
      "viewtemplate": "List",
      "configuration": {
        "layout": {
          "above": [
            null,
            {
              "widths": [
                2,
                10
              ],
              "besides": [
                {
                  "above": [
                    null,
                    {
                      "type": "blank",
                      "block": false,
                      "contents": "Name",
                      "textStyle": ""
                    }
                  ]
                },
                {
                  "above": [
                    null,
                    {
                      "type": "field",
                      "block": false,
                      "fieldview": "as_text",
                      "textStyle": "",
                      "field_name": "name"
                    }
                  ]
                }
              ]
            },
            {
              "type": "line_break"
            },
            {
              "widths": [
                2,
                10
              ],
              "besides": [
                {
                  "above": [
                    null,
                    {
                      "type": "blank",
                      "block": false,
                      "contents": "Salary",
                      "textStyle": ""
                    }
                  ]
                },
                {
                  "above": [
                    null,
                    {
                      "type": "field",
                      "block": false,
                      "fieldview": "show",
                      "textStyle": "",
                      "field_name": "salary"
                    }
                  ]
                }
              ]
            },
            {
              "type": "line_break"
            }
          ]
        },
        "columns": [
          {
            "stat": "Count",
            "type": "Field",
            "view": "Own:ShowStaff",
            "agg_field": "staff",
            "fieldview": "as_text",
            "field_name": "name",
            "join_field": "",
            "view_label": "",
            "action_name": "Delete",
            "state_field": "on",
            "agg_relation": "ProjectStaff.staff"
          }
        ],
        "viewname": "StaffList",
        "default_state": {
          "name": ""
        },
        "view_to_create": "",
        "create_view_display": "Link"
      }
    },
    {
      "name": "Staff",
      "table": "Staff",
      "min_role": 1,
      "menu_label": "Staff",
      "on_root_page": false,
      "viewtemplate": "ListShowList",
      "configuration": {
        "viewname": "Staff",
        "list_view": "StaffList",
        "show_view": "ShowStaff",
        "subtables": {
          "ChildList:ProjectsStaffList.ProjectStaff.staff": false,
          "ChildList:StaffsProjectsList.ProjectStaff.staff": true
        }
      }
    },
    {
      "name": "Pick staff for project",
      "table": "ProjectStaff",
      "min_role": 1,
      "on_root_page": false,
      "viewtemplate": "Edit",
      "configuration": {
        "fixed": {
          "project": 1
        },
        "layout": {
          "above": [
            {
              "widths": [
                2,
                10
              ],
              "besides": [
                {
                  "above": [
                    null,
                    {
                      "type": "blank",
                      "contents": "Staff"
                    }
                  ]
                },
                {
                  "above": [
                    null,
                    {
                      "type": "field",
                      "fieldview": "select",
                      "field_name": "staff"
                    }
                  ]
                }
              ]
            },
            {
              "type": "line_break"
            },
            {
              "type": "action",
              "minRole": 10,
              "action_name": "Save"
            }
          ]
        },
        "columns": [
          {
            "type": "Field",
            "fieldview": "select",
            "field_name": "staff"
          },
          {
            "type": "Action",
            "minRole": 10,
            "action_name": "Save"
          }
        ],
        "viewname": "EditPSStaffOnly",
        "view_when_done": "Staff"
      }
    },
    {
      "name": "Pick project for staff",
      "table": "ProjectStaff",
      "min_role": 1,
      "on_root_page": false,
      "viewtemplate": "Edit",
      "configuration": {
        "fixed": {
          "staff": 1
        },
        "layout": {
          "above": [
            {
              "widths": [
                2,
                10
              ],
              "besides": [
                {
                  "above": [
                    null,
                    {
                      "type": "blank",
                      "contents": "Project"
                    }
                  ]
                },
                {
                  "above": [
                    null,
                    {
                      "type": "field",
                      "fieldview": "select",
                      "field_name": "project"
                    }
                  ]
                }
              ]
            },
            {
              "type": "line_break"
            },
            {
              "type": "action",
              "minRole": 10,
              "action_name": "Save"
            }
          ]
        },
        "columns": [
          {
            "type": "Field",
            "fieldview": "select",
            "field_name": "project"
          },
          {
            "type": "Action",
            "minRole": 10,
            "action_name": "Save"
          }
        ],
        "viewname": "EditPSProjectOnly",
        "view_when_done": "EditProjectStaff"
      }
    },
    {
      "name": "StaffsProjectsList",
      "table": "ProjectStaff",
      "min_role": 1,
      "on_root_page": false,
      "viewtemplate": "List",
      "configuration": {
        "layout": {
          "above": [
            null,
            {
              "widths": [
                2,
                10
              ],
              "besides": [
                {
                  "above": [
                    null,
                    {
                      "type": "blank",
                      "block": false,
                      "contents": "Staff",
                      "textStyle": ""
                    }
                  ]
                },
                {
                  "above": [
                    null,
                    {
                      "type": "join_field",
                      "block": false,
                      "textStyle": "",
                      "join_field": "staff.name"
                    }
                  ]
                }
              ]
            },
            {
              "type": "line_break"
            },
            {
              "widths": [
                2,
                10
              ],
              "besides": [
                {
                  "above": [
                    null,
                    {
                      "type": "blank",
                      "block": false,
                      "contents": "Project",
                      "textStyle": ""
                    }
                  ]
                },
                {
                  "above": [
                    null,
                    {
                      "type": "join_field",
                      "block": false,
                      "textStyle": "",
                      "join_field": "project.name"
                    }
                  ]
                }
              ]
            },
            {
              "type": "line_break"
            }
          ]
        },
        "columns": [
          {
            "stat": "Count",
            "type": "JoinField",
            "view": "ParentShow:ShowStaff.Staff.staff",
            "fieldview": "select",
            "field_name": "staff",
            "join_field": "project.name",
            "view_label": "",
            "action_name": "Delete",
            "action_label": "",
            "agg_relation": ""
          },
          {
            "stat": "Count",
            "type": "JoinField",
            "view": "ParentShow:ShowStaff.Staff.staff",
            "fieldview": "select",
            "field_name": "staff",
            "join_field": "project.value",
            "view_label": "",
            "action_name": "Delete",
            "action_label": "",
            "agg_relation": ""
          },
          {
            "stat": "Count",
            "type": "Action",
            "view": "ParentShow:ShowStaff.Staff.staff",
            "fieldview": "select",
            "field_name": "staff",
            "join_field": "project.name",
            "view_label": "",
            "action_name": "Delete",
            "action_label": "Remove",
            "agg_relation": ""
          }
        ],
        "viewname": "StaffsProjectsList",
        "view_to_create": "Pick project for staff",
        "create_view_label": "Assign to project",
        "create_view_display": "Popup"
      }
    },
    {
      "name": "ProjectsStaffList",
      "table": "ProjectStaff",
      "min_role": 1,
      "on_root_page": false,
      "viewtemplate": "List",
      "configuration": {
        "layout": {
          "above": [
            null,
            {
              "widths": [
                2,
                10
              ],
              "besides": [
                {
                  "above": [
                    null,
                    {
                      "type": "blank",
                      "block": false,
                      "contents": "Staff",
                      "textStyle": ""
                    }
                  ]
                },
                {
                  "above": [
                    null,
                    {
                      "type": "join_field",
                      "block": false,
                      "textStyle": "",
                      "join_field": "staff.name"
                    }
                  ]
                }
              ]
            },
            {
              "type": "line_break"
            },
            {
              "widths": [
                2,
                10
              ],
              "besides": [
                {
                  "above": [
                    null,
                    {
                      "type": "blank",
                      "block": false,
                      "contents": "Project",
                      "textStyle": ""
                    }
                  ]
                },
                {
                  "above": [
                    null,
                    {
                      "type": "join_field",
                      "block": false,
                      "textStyle": "",
                      "join_field": "project.name"
                    }
                  ]
                }
              ]
            },
            {
              "type": "line_break"
            }
          ]
        },
        "columns": [
          {
            "stat": "Count",
            "type": "JoinField",
            "view": "ParentShow:ShowStaff.Staff.staff",
            "fieldview": "select",
            "field_name": "staff",
            "join_field": "staff.name",
            "view_label": "",
            "action_name": "Delete",
            "action_label": "",
            "agg_relation": ""
          },
          {
            "stat": "Count",
            "type": "JoinField",
            "view": "ParentShow:ShowStaff.Staff.staff",
            "fieldview": "select",
            "field_name": "staff",
            "join_field": "staff.salary",
            "view_label": "",
            "action_name": "Delete",
            "action_label": "",
            "agg_relation": ""
          },
          {
            "stat": "Count",
            "type": "Action",
            "view": "ParentShow:ShowStaff.Staff.staff",
            "fieldview": "select",
            "field_name": "staff",
            "join_field": "staff.name",
            "view_label": "",
            "action_name": "Delete",
            "action_label": "Remove",
            "agg_relation": ""
          }
        ],
        "viewname": "ProjectsStaffList",
        "view_to_create": "Pick staff for project",
        "create_view_label": "Assign staff",
        "create_view_display": "Popup"
      }
    }
  ],
  "tables": [
    {
      "name": "Projects",
      "fields": [
        {
          "name": "name",
          "type": "String",
          "label": "Name",
          "stored": false,
          "required": true,
          "is_unique": true,
          "attributes": {
            "options": ""
          },
          "calculated": false,
          "expression": null
        },
        {
          "name": "value",
          "type": "Integer",
          "label": "Value",
          "stored": false,
          "required": false,
          "is_unique": false,
          "attributes": {
            "max": null,
            "min": 0
          },
          "calculated": false,
          "expression": null
        }
      ],
      "versioned": false,
      "min_role_read": 1,
      "min_role_write": 1
    },
    {
      "name": "Staff",
      "fields": [
        {
          "name": "name",
          "type": "String",
          "label": "Name",
          "stored": false,
          "required": true,
          "is_unique": false,
          "attributes": {
            "options": ""
          },
          "calculated": false,
          "expression": null
        },
        {
          "name": "salary",
          "type": "Integer",
          "label": "Salary",
          "stored": false,
          "required": false,
          "is_unique": false,
          "attributes": {
            "max": null,
            "min": 0
          },
          "calculated": false,
          "expression": null
        }
      ],
      "versioned": false,
      "min_role_read": 1,
      "min_role_write": 1
    },
    {
      "name": "ProjectStaff",
      "fields": [
        {
          "name": "staff",
          "type": "Key",
          "label": "Staff",
          "stored": false,
          "required": true,
          "is_unique": false,
          "attributes": {
            "summary_field": "name"
          },
          "calculated": false,
          "expression": null,
          "reftable_name": "Staff"
        },
        {
          "name": "project",
          "type": "Key",
          "label": "Project",
          "stored": false,
          "required": true,
          "is_unique": false,
          "attributes": {
            "summary_field": "name"
          },
          "calculated": false,
          "expression": null,
          "reftable_name": "Projects"
        }
      ],
      "versioned": false,
      "min_role_read": 1,
      "min_role_write": 1
    }
  ],
  "plugins": []
}