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 13:33:23 +01:00
parent f588bc0cda
commit 1606e80f81
5 changed files with 277 additions and 51 deletions

View File

@ -783,3 +783,24 @@ class Beamtime(BaseModel):
proposal: Optional[Proposal]
local_contact_id: Optional[int]
local_contact: Optional[LocalContact]
class Config:
from_attributes = True
class ImageCreate(BaseModel):
pgroup: str
sample_id: int
filepath: str
status: str = "active"
comment: Optional[str] = None
class Config:
from_attributes = True
class Image(ImageCreate):
id: int
class Config:
from_attributes = True