ogn-python/app/model/airport.py

39 wiersze
1.1 KiB
Python
Czysty Zwykły widok Historia

2017-10-03 11:31:24 +00:00
from geoalchemy2.types import Geometry
2016-04-22 08:44:39 +00:00
2019-08-31 08:14:41 +00:00
from app import db
2016-04-22 08:44:39 +00:00
2019-02-10 12:10:19 +00:00
class Airport(db.Model):
__tablename__ = "airports"
2016-04-22 08:44:39 +00:00
2019-02-10 12:25:24 +00:00
id = db.Column(db.Integer, primary_key=True)
2016-04-22 08:44:39 +00:00
2019-08-31 08:14:41 +00:00
location_wkt = db.Column("location", Geometry("POINT", srid=4326))
2019-02-10 12:25:24 +00:00
altitude = db.Column(db.Float(precision=2))
2019-02-10 12:25:24 +00:00
name = db.Column(db.String, index=True)
code = db.Column(db.String(6))
country_code = db.Column(db.String(2))
style = db.Column(db.SmallInteger)
description = db.Column(db.String)
runway_direction = db.Column(db.SmallInteger)
runway_length = db.Column(db.SmallInteger)
frequency = db.Column(db.Float(precision=2))
2016-04-22 08:44:39 +00:00
2019-08-31 08:14:41 +00:00
border = db.Column("border", Geometry("POLYGON", srid=4326))
2019-01-01 19:12:25 +00:00
2016-04-22 08:44:39 +00:00
def __repr__(self):
return "<Airport %s: %s,%s,%s,%s,%s,%s,%s,%s,%s,% s>" % (
self.name,
self.code,
self.country_code,
self.style,
self.description,
self.location_wkt.latitude,
self.location_wkt.longitude,
2016-04-22 08:44:39 +00:00
self.altitude,
self.runway_direction,
self.runway_length,
2019-08-31 08:14:41 +00:00
self.frequency,
)