diff --git a/agenda/types.py b/agenda/types.py index bf69cb7..1e0ba44 100644 --- a/agenda/types.py +++ b/agenda/types.py @@ -55,17 +55,21 @@ class Trip: return max_date if max_date != date.min else None @property - def countries(self) -> set[Country]: - """Trip countries.""" - found: set[Country] = set() + def countries(self) -> list[Country]: + """Countries visited as part of trip, in order.""" + seen: set[str] = set() + items: list[Country] = [] for item in self.conferences + self.accommodation: if "country" not in item: continue + if item["country"] in seen: + continue + seen.add(item["country"]) country = agenda.get_country(item["country"]) assert country - found.add(country) + items.append(country) - return found + return items @property def countries_str(self) -> str: