diff --git a/gtfsdb/__init__.py b/gtfsdb/__init__.py index 7a7ffcd..c6d1b94 100644 --- a/gtfsdb/__init__.py +++ b/gtfsdb/__init__.py @@ -15,6 +15,7 @@ from gtfsdb.model.stop_feature import * # noqa from gtfsdb.model.stop_time import StopTime # noqa from gtfsdb.model.transfer import Transfer # noqa +from gtfsdb.model.translation import Translation # noqa from gtfsdb.model.trip import Trip # noqa from gtfsdb.model.block import Block # noqa @@ -42,6 +43,7 @@ FareAttribute.__name__, FareRule.__name__, UniversalCalendar.__name__, + Translation.__name__, ] diff --git a/gtfsdb/model/translation.py b/gtfsdb/model/translation.py new file mode 100644 index 0000000..df238c6 --- /dev/null +++ b/gtfsdb/model/translation.py @@ -0,0 +1,21 @@ +from sqlalchemy import Column, Integer, Sequence +from sqlalchemy.types import String + +from gtfsdb import config +from gtfsdb.model.base import Base + + +class Translation(Base): + datasource = config.DATASOURCE_GTFS + filename = 'translations.txt' + + __tablename__ = 'translations' + + id = Column(Integer, Sequence(None, optional=True), primary_key=True) + table_name = Column(String(255), nullable=False) + field_name = Column(String(255), nullable=False) + language = Column(String(255), nullable=False) + translation = Column(String(255), nullable=False) + record_id = Column(String(255)) + record_sub_id = Column(String(255)) + field_value = Column(String(255))