31 lines
1018 B
Python
31 lines
1018 B
Python
"""
|
|
Model representation of a City
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
|
Copyright © 2022 Concordia CERC group
|
|
Project Coder Peter Yefi peteryefi@gmail.com
|
|
"""
|
|
|
|
from sqlalchemy import Column, Integer, String, Sequence, PickleType, Float
|
|
from persistence.db_config import Base
|
|
from sqlalchemy.dialects.postgresql import JSONB
|
|
|
|
|
|
class City(Base):
|
|
"""A model representation of a city
|
|
"""
|
|
__tablename__ = "city"
|
|
id = Column(Integer, Sequence('city_id_seq'), primary_key=True)
|
|
city = Column(PickleType, nullable=False)
|
|
name = Column(String, nullable=False)
|
|
srs_name = Column(String, nullable=False)
|
|
climate_reference_city = Column(String, nullable=True)
|
|
time_zone = Column(String, nullable=True)
|
|
country_code = Column(String, nullable=False)
|
|
latitude = Column(Float)
|
|
longitude = Column(Float)
|
|
lower_corner = Column(JSONB, nullable=False)
|
|
upper_corner = Column(JSONB, nullable=False)
|
|
hub_release = Column(String, nullable=False)
|
|
city_version = Column(Integer, nullable=False)
|
|
|