From bd393796f5d1f87de734f3e2c82476794fc64680 Mon Sep 17 00:00:00 2001 From: Mo8it Date: Wed, 18 Aug 2021 18:58:20 +0200 Subject: [PATCH] Fixed weighting defaults --- advlabdb/models.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/advlabdb/models.py b/advlabdb/models.py index 8cfc3b5..84d09c9 100644 --- a/advlabdb/models.py +++ b/advlabdb/models.py @@ -192,12 +192,17 @@ class Experiment(db.Model): active = db.Column(db.Boolean, default=True, nullable=False) oral_weighting = db.Column( - db.Float, db.CheckConstraint("oral_weighting >= 0"), db.CheckConstraint("oral_weighting <= 1"), nullable=False + db.Float, + db.CheckConstraint("oral_weighting >= 0"), + db.CheckConstraint("oral_weighting <= 1"), + default=0.5, + nullable=False, ) protocol_weighting = db.Column( db.Float, db.CheckConstraint("protocol_weighting >= 0"), db.CheckConstraint("protocol_weighting <= 1"), + default=0.5, nullable=False, ) final_weighting = db.Column( @@ -399,14 +404,12 @@ class ExperimentMark(db.Model): db.Integer, db.CheckConstraint("oral_mark > -1"), db.CheckConstraint("oral_mark < 16"), - default=0.5, nullable=True, ) protocol_mark = db.Column( db.Integer, db.CheckConstraint("protocol_mark > -1"), db.CheckConstraint("protocol_mark < 16"), - default=0.5, nullable=True, )