ogn-python/ogn/model/device.py

35 wiersze
937 B
Python
Czysty Zwykły widok Historia

2015-10-24 21:13:21 +00:00
from sqlalchemy import Column, Integer, String, Unicode, Boolean, SmallInteger
2015-10-30 20:19:03 +00:00
from .base import Base
2015-10-24 21:13:21 +00:00
2015-11-16 19:04:54 +00:00
class Device(Base):
__tablename__ = 'device'
2015-10-24 21:13:21 +00:00
id = Column(Integer, primary_key=True)
address_type = None
address = Column(String(6), index=True)
name = Column(Unicode)
airport = Column(String)
aircraft = Column(String)
registration = Column(String(7), index=True)
competition = Column(String(3))
frequency = Column(String)
tracked = Column(Boolean)
identified = Column(Boolean)
address_origin = Column(SmallInteger)
def __repr__(self):
2015-11-16 19:04:54 +00:00
return "<Device: %s,%s,%s,%s,%s,%s,%s,%s,%s,%s>" % (
2015-11-15 18:31:58 +00:00
self.address_type,
self.address,
self.name,
self.airport,
self.aircraft,
self.registration,
self.competition,
self.frequency,
self.tracked,
self.identified)