diff --git a/observations/models.py b/observations/models.py index 5969a74..b5d936a 100644 --- a/observations/models.py +++ b/observations/models.py @@ -117,6 +117,15 @@ def _observed_as_string(self): return ", ".join([ test.parameter.name for test in self.parameters.all()]) + def get_timestamp(self): + """Return the most useful timestamp.""" + return self.reference_timestamp or self.created_timestamp + + def get_location(self): + """Return a nice location name.""" + return self.location_reference or "{0:0.2f}, {1:0.2f}".format( + self.location.x, self.location.y) + class TestValue(models.Model): """A Test, as measured during a Measurement, resulting in a Value.""" diff --git a/openwater/templates/home.html b/openwater/templates/home.html index d5bfc19..be8baa4 100644 --- a/openwater/templates/home.html +++ b/openwater/templates/home.html @@ -66,6 +66,16 @@