-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathmodels.py
More file actions
23 lines (19 loc) · 760 Bytes
/
Copy pathmodels.py
File metadata and controls
23 lines (19 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from sqlalchemy import Column, Integer, String, DateTime
from database import Base
from datetime import datetime
class Flight(Base):
__tablename__ = 'flights'
id = Column(Integer, primary_key=True)
flight = Column(String(50))
destination = Column(String(120))
check_in = Column(DateTime, default=datetime.utcnow)
departure = Column(DateTime, default=datetime.utcnow)
status = Column(String(120))
def __init__(self, flight=None, destination=None, check_in=None, departure=None, status=None):
self.flight = flight
self.destination = destination
self.check_in = check_in
self.departure = departure
self.status = status
def __repr__(self):
return '<Flight %r>' % (self.flight)