refactor to make way for dockerization

This commit is contained in:
2022-11-19 16:44:50 -05:00
parent 400c870056
commit ab63eeff96
25 changed files with 1 additions and 1 deletions

11
app/create_events.py Normal file
View File

@@ -0,0 +1,11 @@
def createEvents(db, currDay, Period, Event):
periods = Period.query.all()
for period in periods:
q = db.session.query(Event).filter(Event.scheduled_date == currDay).filter(Event.period_num == period.period)
isEventsExist = db.session.query(q.exists()).scalar()
if isEventsExist == False:
event = Event(scheduled_date=currDay,
period_num=period.period
)
db.session.add(event)
db.session.commit()