mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-12-20 23:41:20 +00:00
Fix max mark constraint
This commit is contained in:
parent
0ee5fcd52b
commit
e891fe4050
1 changed files with 3 additions and 3 deletions
|
@ -501,20 +501,20 @@ class ExperimentMark(db.Model):
|
||||||
oral_mark = db.Column(
|
oral_mark = db.Column(
|
||||||
db.Integer,
|
db.Integer,
|
||||||
db.CheckConstraint(f"oral_mark >= {MIN_MARK}"),
|
db.CheckConstraint(f"oral_mark >= {MIN_MARK}"),
|
||||||
db.CheckConstraint(f"oral_mark <= {MIN_MARK}"),
|
db.CheckConstraint(f"oral_mark <= {MAX_MARK}"),
|
||||||
nullable=True,
|
nullable=True,
|
||||||
)
|
)
|
||||||
protocol_mark = db.Column(
|
protocol_mark = db.Column(
|
||||||
db.Integer,
|
db.Integer,
|
||||||
db.CheckConstraint(f"oral_mark >= {MIN_MARK}"),
|
db.CheckConstraint(f"oral_mark >= {MIN_MARK}"),
|
||||||
db.CheckConstraint(f"oral_mark <= {MIN_MARK}"),
|
db.CheckConstraint(f"oral_mark <= {MAX_MARK}"),
|
||||||
nullable=True,
|
nullable=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
final_experiment_mark = db.Column(
|
final_experiment_mark = db.Column(
|
||||||
db.Integer,
|
db.Integer,
|
||||||
db.CheckConstraint(f"oral_mark >= {MIN_MARK}"),
|
db.CheckConstraint(f"oral_mark >= {MIN_MARK}"),
|
||||||
db.CheckConstraint(f"oral_mark <= {MIN_MARK}"),
|
db.CheckConstraint(f"oral_mark <= {MAX_MARK}"),
|
||||||
onupdate=final_experiment_mark_update,
|
onupdate=final_experiment_mark_update,
|
||||||
nullable=True,
|
nullable=True,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue