Add Image models and clean up test code structure

Introduced `ImageCreate` and `Image` models to handle image-related data in the backend. Improved the organization and readability of the testing notebook by consolidating and formatting code into distinct sections with markdown cells.
This commit is contained in:
GotthardG
2025-02-26 15:11:20 +01:00
parent 1606e80f81
commit b04c7b8c95
8 changed files with 191 additions and 11 deletions

View File

@ -3,8 +3,8 @@
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-02-26T12:02:38.993926Z",
"start_time": "2025-02-26T12:02:38.991283Z"
"end_time": "2025-02-26T13:09:58.719218Z",
"start_time": "2025-02-26T13:09:58.716771Z"
}
},
"cell_type": "code",
@ -46,7 +46,7 @@
]
}
],
"execution_count": 74
"execution_count": 86
},
{
"metadata": {},
@ -528,8 +528,8 @@
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-02-26T12:29:51.615501Z",
"start_time": "2025-02-26T12:29:51.592886Z"
"end_time": "2025-02-26T13:17:13.591355Z",
"start_time": "2025-02-26T13:17:13.561947Z"
}
},
"cell_type": "code",
@ -546,7 +546,7 @@
" mime_type = \"application/octet-stream\"\n",
"\n",
"# Sample ID (ensure this exists on your backend)\n",
"sample_id = 58\n",
"sample_id = 16\n",
"\n",
"# Build the URL for the upload endpoint.\n",
"url = f\"https://127.0.0.1:8000/samples/{sample_id}/upload-images\"\n",
@ -580,7 +580,7 @@
"text": [
"API Response:\n",
"200\n",
"{'pgroup': 'p20001, p20002', 'sample_id': 58, 'filepath': 'images/p20001, p20002/2025-02-26/Dewar One/PUCK007/12/IMG_1942.jpg', 'status': 'active', 'comment': None, 'id': 1}\n"
"{'pgroup': 'p20001', 'sample_id': 16, 'filepath': 'images/p20001/2025-02-26/Dewar One/PUCK-001/16/IMG_1942.jpg', 'status': 'active', 'comment': None, 'id': 3}\n"
]
},
{
@ -592,7 +592,7 @@
]
}
],
"execution_count": 85
"execution_count": 88
},
{
"metadata": {},