added branch

This commit is contained in:
2025-02-18 18:24:04 +01:00
parent 444c47e3a4
commit 357edf3000
7 changed files with 10140 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
"""Definition of the Landmark class to handle visitable objects across the world."""
from typing import Optional, Literal
from typing import Optional, Literal, List
from uuid import uuid4, UUID
from pydantic import BaseModel, ConfigDict, Field
@@ -50,7 +50,7 @@ class Landmark(BaseModel) :
image_url : Optional[str] = None
website_url : Optional[str] = None
wiki_url : Optional[str] = None
description : Optional[str] = None # TODO future
description : Optional[str] = None
duration : Optional[int] = 5
name_en : Optional[str] = None
@@ -69,6 +69,12 @@ class Landmark(BaseModel) :
is_viewpoint : Optional[bool] = False
is_place_of_worship : Optional[bool] = False
class Config:
json_encoders = {
UUID: lambda v: str(v) # Ensure UUID is serialized as a string
}
def __str__(self) -> str:
"""
String representation of the Landmark object.