跳到主要内容

表

方法与权限​

APIGETPOSTPUTPATCHDELETE
表列表管理员, 成员管理员---
表详情管理员, 成员--管理员-

获取表列表​

端点: /tables/table/list/{level}/{sid}/{serializer}/

参数: level (路径, 字符串)​

organization

参数: sid (路径, 字符串)​

organization sid

参数: serializer (路径, 字符串)​

参数: token (头部, 字符串)​

响应: 200 — serializer = list​

# serializer = name
{
"page_size": 10,
"page_number": 1,
"page_count": 1,
"count": 9,
"next": null,
"previous": null,
"add_permission": true,
"results": [
{
"sid": "xxx",
"name": "experiment",
"name_plural": "experiments",
"name_singular": "experiment"
},
...
]
}
# serializer = list
{
"page_size": 10,
"page_number": 1,
"page_count": 1,
"count": 9,
"next": null,
"previous": null,
"add_permission": true,
"results": [
{
"sid": "xxx",
"icon": "xxx",
"name_singular": "experiment",
"name_plural": "experiments",
"unique_code": "EP",
"table_type": "Document",
"order": 1,
"is_archived": false,
"change_permission": true
},
...
]
}
# serializer = detail
{
"page_size": 10,
"page_number": 1,
"page_count": 1,
"count": 9,
"next": null,
"previous": null,
"add_permission": true,
"results": [
{
"sid": "xxx",
"icon": "assignment",
"name": "experiments",
"name_singular": "experiment",
"name_plural": "experiments",
"name_system": null,
"description": "An experiment is the lab note that document the purpose, the procedures the results of the experiment.",
"unique_code": "EP",
"default_view": "detail",
"order": 3,
"number_of_records": 4,
"number_of_columns": 2,
"number_of_sections": 6,
"number_of_filters": 2,
"number_of_workflows": 3,
"metadata": [

],
"default_filter": null,
"is_archived": false,
"updated_by": "xxx",
"date_updated": "2020-05-25T00:35:21.236133Z",
"date_created": "2020-05-25T00:35:21.234651Z",
"change_permission": true
},
...
]
}

创建表列表​

端点: /tables/table/list/{level}/{sid}/{serializer}/

参数: level (路径, 字符串)​

organization

参数: sid (路径, 字符串)​

organization sid

参数: serializer (路径, 字符串)​

参数: token (头部, 字符串)​

参数: name_singular (正文, 字符串)​

参数: name_plural (正文, 字符串)​

参数: description (正文, 字符串)​

参数: unique_code (正文, 字符串)​

参数: icon (正文, 字符串)​

参数: table_type (正文, 字符串)​

参数: is_archived (正文, 布尔值)​

响应: 201​

{
"sid": "xxx",
"icon": "assignment",
"name": "experiments",
"name_singular": "experiment",
"name_plural": "experiments",
"name_system": null,
"description": "An experiment is the lab note that document the purpose, the procedures the results of the experiment.",
"unique_code": "EP",
"default_view": "detail",
"order": 3,
"number_of_records": 4,
"number_of_columns": 2,
"number_of_sections": 6,
"number_of_filters": 2,
"number_of_workflows": 3,
"metadata": [

],
"default_filter": null,
"is_archived": false,
"updated_by": "xxx",
"date_updated": "2020-05-25T00:35:21.236133Z",
"date_created": "2020-05-25T00:35:21.234651Z",
"change_permission": true
}

响应: 400​

{"non_field_errors":
[
"The fields organization, name_plural must make a unique set.",
"The fields organization, name_singular must make a unique set.",
"The fields organization, unique_code must make a unique set."
]
}

获取表详情​

端点: /tables/table/detail/{sid}/

参数: sid (路径, 字符串)​

参数: token (头部, 字符串)​

响应: 200​

{
"sid": "xxx",
"icon": "assignment",
"name": "experiments",
"name_singular": "experiment",
"name_plural": "experiments",
"name_system": null,
"description": "An experiment is the lab note that document the purpose, the procedures the results of the experiment.",
"unique_code": "EP",
"default_view": "detail",
"order": 3,
"number_of_records": 4,
"number_of_columns": 2,
"number_of_sections": 6,
"number_of_filters": 2,
"number_of_workflows": 3,
"metadata": [

],
"default_filter": null,
"is_archived": false,
"updated_by": "xxx",
"date_updated": "2020-05-25T00:35:21.236133Z",
"date_created": "2020-05-25T00:35:21.234651Z",
"change_permission": true
}

修补表详情​

端点: /tables/table/detail/{sid}/

参数: sid (路径, 字符串)​

参数: token (头部, 字符串)​

参数: name_singular (正文, 字符串)​

参数: name_plural (正文, 字符串)​

参数: description (正文, 字符串)​

参数: unique_code (正文, 字符串)​

参数: icon (正文, 字符串)​

参数: order (正文, 数字)​

参数: table_type (正文, 字符串)​

参数: is_archived (正文, 布尔值)​

响应: 200​

{
"sid": "xxx",
"icon": "assignment",
"name": "experiments",
"name_singular": "experiment",
"name_plural": "experiments",
"name_system": null,
"description": "An experiment is the lab note that document the purpose, the procedures the results of the experiment.",
"unique_code": "EP",
"default_view": "detail",
"order": 3,
"number_of_records": 4,
"number_of_columns": 2,
"number_of_sections": 6,
"number_of_filters": 2,
"number_of_workflows": 3,
"metadata": [

],
"default_filter": null,
"is_archived": false,
"updated_by": "xxx",
"date_updated": "2020-05-25T00:35:21.236133Z",
"date_created": "2020-05-25T00:35:21.234651Z",
"change_permission": true
}