diff --git a/lib/xmet/sounding.py b/lib/xmet/sounding.py index 96854ca..2ffedee 100644 --- a/lib/xmet/sounding.py +++ b/lib/xmet/sounding.py @@ -82,6 +82,18 @@ class Sounding(DatabaseTable): 'data_source_pressure', 'data_source_other', 'samples', 'location' ) + def __str__(self): + parts = [ + f"Sounding from station {self.station}" + ] + + if self.location is not None: + parts.append(f"(location {self.location})") + + parts.append(f"observed {self.timestamp_observed}") + + return ' '.join(parts) + __table__ = 'xmet_sounding' __key__ = 'id' @@ -117,7 +129,8 @@ class Sounding(DatabaseTable): def __init__(self): super().__init__() - self.id = None + self.id = None + self.location = None @staticmethod def valid_by_station(db: Database,