add status functionality

This commit is contained in:
2025-05-26 10:33:09 +03:00
parent 4897a5050d
commit 50e6da10f1
7 changed files with 92 additions and 49 deletions

View File

@@ -105,6 +105,17 @@ class Route(models.Model):
blank=True, null=True
)
status = models.CharField(
max_length=20,
choices=[
("actual", "Актуально"),
("canceled", "Отменено"),
("completed", "Завершено"),
],
default="actual",
)
created_at = models.DateTimeField(auto_now_add=True, null=True, blank=True)
def __str__(self) -> str:
from_city_name = self.from_city.name if self.from_city else 'Не указан'
to_city_name = self.to_city.name if self.to_city else 'Не указан'