added pucks and samples

This commit is contained in:
GotthardG
2024-11-04 11:34:14 +01:00
parent a9b8925be8
commit 23e7ebb819
17 changed files with 378 additions and 112 deletions

11
backend/app/utils.py Normal file
View File

@ -0,0 +1,11 @@
from app.models import Dewar
def calculate_number_of_pucks(dewar: Dewar) -> int:
return len(dewar.pucks) if dewar.pucks else 0
def calculate_number_of_samples(dewar: Dewar) -> int:
if not dewar.pucks:
return 0
return sum(len(puck.positions) for puck in dewar.pucks)