Add beamtime relationships and enhance sample handling
This commit adds relationships to link Pucks and Samples to Beamtime in the models, enabling better data association. Includes changes to assign beamtime IDs during data generation and updates in API response models for improved data loading. Removed redundant code in testfunctions.ipynb to clean up the notebook.
This commit is contained in:
@ -425,6 +425,7 @@ def create_result(payload: ResultCreate, db: Session = Depends(get_db)):
|
||||
|
||||
result_entry = ResultsModel(
|
||||
sample_id=payload.sample_id,
|
||||
status=payload.status,
|
||||
run_id=payload.run_id,
|
||||
result=payload.result.model_dump(), # Serialize entire result to JSON
|
||||
)
|
||||
@ -435,6 +436,7 @@ def create_result(payload: ResultCreate, db: Session = Depends(get_db)):
|
||||
|
||||
return ResultResponse(
|
||||
id=result_entry.id,
|
||||
status=result_entry.status,
|
||||
sample_id=result_entry.sample_id,
|
||||
run_id=result_entry.run_id,
|
||||
result=payload.result, # return original payload directly
|
||||
|
Reference in New Issue
Block a user