Prepare code for Eurostar/Trenitalia France/RENFE/ÖBB data input

This commit is contained in:
2024-02-10 17:33:36 +01:00
parent 77c3ef9e74
commit 16520c3664
19 changed files with 463 additions and 108 deletions

View File

@ -7,6 +7,10 @@ class TransportType(models.TextChoices):
TER = "TER", _("TER")
INTERCITES = "IC", _("Intercités")
TRANSILIEN = "TN", _("Transilien")
EUROSTAR = "ES", _("Eurostar")
TRENITALIA = "TI", _("Trenitalia")
RENFE = "RENFE", _("Renfe")
OBB = "OBB", _("ÖBB")
class LocationType(models.IntegerChoices):
@ -84,7 +88,6 @@ class Agency(models.Model):
name = models.CharField(
max_length=255,
unique=True,
verbose_name=_("Agency name"),
)
@ -206,6 +209,12 @@ class Stop(models.Model):
blank=True,
)
transport_type = models.CharField(
max_length=255,
verbose_name=_("Transport type"),
choices=TransportType,
)
@property
def stop_type(self):
train_type = self.id.split('StopPoint:OCE')[1].split('-')[0]