mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-11-08 21:21:06 +00:00
Changed Datetime to Date for Appointment
This commit is contained in:
parent
8444f9babc
commit
c09ab2ffdc
3 changed files with 5 additions and 5 deletions
File diff suppressed because one or more lines are too long
|
@ -122,7 +122,7 @@ class Assistant(db.Model):
|
||||||
|
|
||||||
class Appointment(db.Model):
|
class Appointment(db.Model):
|
||||||
id = db.Column(db.Integer, primary_key=True)
|
id = db.Column(db.Integer, primary_key=True)
|
||||||
date = db.Column(db.DateTime, nullable=False) # To be specified with the python package "datetime"
|
date = db.Column(db.Date, nullable=False) # To be specified with the python package "datetime"
|
||||||
special = db.Column(db.Boolean, nullable=False) # In the break or not
|
special = db.Column(db.Boolean, nullable=False) # In the break or not
|
||||||
group_experiment_id = db.Column(db.Integer, db.ForeignKey("group_experiment.id"), nullable=False)
|
group_experiment_id = db.Column(db.Integer, db.ForeignKey("group_experiment.id"), nullable=False)
|
||||||
assistant_id = db.Column(db.Integer, db.ForeignKey("assistant.id"), nullable=False)
|
assistant_id = db.Column(db.Integer, db.ForeignKey("assistant.id"), nullable=False)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from datetime import datetime
|
from datetime import date
|
||||||
|
|
||||||
from flask_security import hash_password
|
from flask_security import hash_password
|
||||||
|
|
||||||
|
@ -106,8 +106,8 @@ with app.app_context():
|
||||||
db.session.add(as1)
|
db.session.add(as1)
|
||||||
db.session.add(as2)
|
db.session.add(as2)
|
||||||
|
|
||||||
ap1 = Appointment(date=datetime(2021, 3, 21), special=True, group_experiment=gx1, assistant=as1)
|
ap1 = Appointment(date=date(2021, 3, 21), special=True, group_experiment=gx1, assistant=as1)
|
||||||
ap2 = Appointment(date=datetime(2021, 3, 22), special=True, group_experiment=gx2, assistant=as2)
|
ap2 = Appointment(date=date(2021, 3, 22), special=True, group_experiment=gx2, assistant=as2)
|
||||||
|
|
||||||
db.session.add(ap1)
|
db.session.add(ap1)
|
||||||
db.session.add(ap2)
|
db.session.add(ap2)
|
||||||
|
|
Loading…
Reference in a new issue