ogn-python/ogn_python/model/device_info.py

31 wiersze
907 B
Python
Czysty Zwykły widok Historia

from ogn_python import db
2016-06-21 17:34:05 +00:00
2019-02-10 12:10:19 +00:00
class DeviceInfo(db.Model):
__tablename__ = 'device_infos'
2016-06-21 17:34:05 +00:00
2019-02-10 12:25:24 +00:00
id = db.Column(db.Integer, primary_key=True)
2016-06-21 17:34:05 +00:00
address_type = None
2019-02-10 12:25:24 +00:00
#address = db.Column(db.String(6), index=True)
address = db.Column(db.String, index=True)
aircraft = db.Column(db.String)
registration = db.Column(db.String(7))
competition = db.Column(db.String(3))
tracked = db.Column(db.Boolean)
identified = db.Column(db.Boolean)
aircraft_type = db.Column(db.SmallInteger)
2016-06-21 17:34:05 +00:00
2019-02-10 12:25:24 +00:00
address_origin = db.Column(db.SmallInteger)
2016-06-21 17:34:05 +00:00
def __repr__(self):
2017-12-13 13:22:31 +00:00
return "<DeviceInfo: %s,%s,%s,%s,%s,%s,%s,%s,%s>" % (
2016-06-21 17:34:05 +00:00
self.address_type,
self.address,
self.aircraft,
self.registration,
self.competition,
self.tracked,
2017-12-13 13:22:31 +00:00
self.identified,
self.aircraft_type,
self.address_origin)