From ed0c5f51b49969c83a7ae4ae1bab91522c61e26f Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Mon, 23 Sep 2024 16:51:18 +0200 Subject: [PATCH] Add __repr__ to Race class --- formula10/domain/model/race.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/formula10/domain/model/race.py b/formula10/domain/model/race.py index 8302d9f..1207bba 100644 --- a/formula10/domain/model/race.py +++ b/formula10/domain/model/race.py @@ -36,6 +36,9 @@ class Race: def __hash__(self) -> int: return hash(self.id) + def __repr__(self) -> str: + return f"race(\n\tid={self.id}, name={self.name}, number={self.number},\n\tdate={self.date}, quali_date={self.quali_date},\n\thas_sprint={self.has_sprint}, place_to_guess={self.place_to_guess}\n)" + id: int name: str number: int @@ -46,4 +49,4 @@ class Race: @property def name_sanitized(self) -> str: - return quote(self.name) \ No newline at end of file + return quote(self.name)