1
0
Fork 0
mirror of https://codeberg.org/Mo8it/AdvLabDB.git synced 2024-09-19 18:31:16 +00:00

Changed Datetime to Date for Appointment

This commit is contained in:
Mo 2021-07-01 01:02:44 +02:00
parent 8444f9babc
commit c09ab2ffdc
3 changed files with 5 additions and 5 deletions

File diff suppressed because one or more lines are too long

View file

@ -122,7 +122,7 @@ class Assistant(db.Model):
class Appointment(db.Model):
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
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)

View file

@ -1,4 +1,4 @@
from datetime import datetime
from datetime import date
from flask_security import hash_password
@ -106,8 +106,8 @@ with app.app_context():
db.session.add(as1)
db.session.add(as2)
ap1 = Appointment(date=datetime(2021, 3, 21), special=True, group_experiment=gx1, assistant=as1)
ap2 = Appointment(date=datetime(2021, 3, 22), special=True, group_experiment=gx2, assistant=as2)
ap1 = Appointment(date=date(2021, 3, 21), special=True, group_experiment=gx1, assistant=as1)
ap2 = Appointment(date=date(2021, 3, 22), special=True, group_experiment=gx2, assistant=as2)
db.session.add(ap1)
db.session.add(ap2)