From 09c4403812f9edf0a8d9cba6853d537759651232 Mon Sep 17 00:00:00 2001 From: itskovacs Date: Sat, 4 Oct 2025 13:07:27 +0200 Subject: [PATCH] :lipstick: Trip: order place by name --- backend/trip/models/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/trip/models/models.py b/backend/trip/models/models.py index 396d1e5..4892b80 100644 --- a/backend/trip/models/models.py +++ b/backend/trip/models/models.py @@ -259,7 +259,7 @@ class Trip(TripBase, table=True): image: Image | None = Relationship(back_populates="trips") user: str = Field(foreign_key="user.username", ondelete="CASCADE") - places: list["Place"] = Relationship(back_populates="trips", link_model=TripPlaceLink) + places: list["Place"] = Relationship(back_populates="trips", sa_relationship_kwargs={"order_by": "Place.name"}, link_model=TripPlaceLink) days: list["TripDay"] = Relationship(back_populates="trip", sa_relationship_kwargs={"order_by": "TripDay.label"}, cascade_delete=True) shares: list["TripShare"] = Relationship(back_populates="trip", cascade_delete=True) packing_items: list["TripPackingListItem"] = Relationship(back_populates="trip", cascade_delete=True)