From f83a2ae152d60c56724b7842110f71908852b932 Mon Sep 17 00:00:00 2001 From: winet Date: Sat, 3 Feb 2024 14:51:01 +0000 Subject: [PATCH] Changed date and time representation for tasks --- .../api/tasks/templates/tasks_cards.j2 | 56 ++++++++++--------- app/models/task.py | 2 +- 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/app/blueprints/api/tasks/templates/tasks_cards.j2 b/app/blueprints/api/tasks/templates/tasks_cards.j2 index 9f3442d..3cd02b5 100644 --- a/app/blueprints/api/tasks/templates/tasks_cards.j2 +++ b/app/blueprints/api/tasks/templates/tasks_cards.j2 @@ -3,34 +3,33 @@

{{ task.name }}

-
    -
  • Дата и время: {{ task.datetime }}
  • -
  • Статус: {{ task.status }}
  • -
  • Сообщение: {{ task.status_message }}
  • -
  • Действие: {{ task.type }}
  • - -
  • - - -
  • -
-
{% else %} diff --git a/app/models/task.py b/app/models/task.py index ca4c755..71756d0 100644 --- a/app/models/task.py +++ b/app/models/task.py @@ -13,7 +13,7 @@ class Task(db.Model): session_id = Column(Integer, ForeignKey("session.id")) session: Mapped['Session'] = relationship("Session", back_populates="tasks") - datetime: Mapped[DateTime] = Column(DateTime, default=datetime.datetime.utcnow().strftime("%d.%m.%y %H:%M")) + datetime: Mapped[DateTime] = Column(DateTime, default=datetime.datetime.utcnow()) status: Mapped[str] status_message: Mapped[str] type: Mapped[str]