Manage trip additions and cancels
This commit is contained in:
@ -58,7 +58,17 @@ class ExceptionType(models.IntegerChoices):
|
||||
REMOVED = 2, _("Removed")
|
||||
|
||||
|
||||
class ScheduleRelationship(models.IntegerChoices):
|
||||
class TripScheduleRelationship(models.IntegerChoices):
|
||||
SCHEDULED = 0, _("Scheduled")
|
||||
ADDED = 1, _("Added")
|
||||
UNSCHEDULED = 2, _("Unscheduled")
|
||||
CANCELED = 3, _("Canceled")
|
||||
REPLACEMENT = 5, _("Replacement")
|
||||
DUPLICATED = 6, _("Duplicated")
|
||||
DELETED = 7, _("Deleted")
|
||||
|
||||
|
||||
class StopScheduleRelationship(models.IntegerChoices):
|
||||
SCHEDULED = 0, _("Scheduled")
|
||||
SKIPPED = 1, _("Skipped")
|
||||
NO_DATA = 2, _("No data")
|
||||
@ -199,12 +209,6 @@ class Stop(models.Model):
|
||||
@property
|
||||
def stop_type(self):
|
||||
train_type = self.id.split('StopPoint:OCE')[1].split('-')[0]
|
||||
if train_type == "Train TER":
|
||||
train_type = "TER"
|
||||
elif train_type == "INTERCITES":
|
||||
train_type = "INTER-CITÉS"
|
||||
elif train_type == "INTERCITES de nuit":
|
||||
train_type = "INTER-CITÉS de nuit"
|
||||
return train_type
|
||||
|
||||
def __str__(self):
|
||||
@ -660,8 +664,8 @@ class TripUpdate(models.Model):
|
||||
|
||||
schedule_relationship = models.IntegerField(
|
||||
verbose_name=_("Schedule relationship"),
|
||||
choices=ScheduleRelationship,
|
||||
default=ScheduleRelationship.SCHEDULED,
|
||||
choices=TripScheduleRelationship,
|
||||
default=TripScheduleRelationship.SCHEDULED,
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
@ -708,8 +712,8 @@ class StopTimeUpdate(models.Model):
|
||||
|
||||
schedule_relationship = models.IntegerField(
|
||||
verbose_name=_("Schedule relationship"),
|
||||
choices=ScheduleRelationship,
|
||||
default=ScheduleRelationship.SCHEDULED,
|
||||
choices=StopScheduleRelationship,
|
||||
default=StopScheduleRelationship.SCHEDULED,
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
|
Reference in New Issue
Block a user