diff options
Diffstat (limited to 'core/models')
-rw-r--r-- | core/models/caves.py | 6 | ||||
-rw-r--r-- | core/models/survex.py | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/core/models/caves.py b/core/models/caves.py index 4827095..3079ed1 100644 --- a/core/models/caves.py +++ b/core/models/caves.py @@ -158,9 +158,11 @@ class Cave(TroggleModel): for e in CaveAndEntrance.objects.filter(cave=self): if e.entrance.best_station() and e.entrance.best_station() != "": #print(self, e, e.entrance.best_station()) - if e.entrance.best_station_object().x: - # print(f"{self} {e.entrance.best_station_object()} {e.entrance.best_station_object().x}") + try: + x = e.entrance.best_station_object().x no_data = False + except: + pass return no_data def singleentrance(self): diff --git a/core/models/survex.py b/core/models/survex.py index 68bae05..6e2a06f 100644 --- a/core/models/survex.py +++ b/core/models/survex.py @@ -58,6 +58,7 @@ class SurvexStation(models.Model): x = models.FloatField(blank=True, null=True) y = models.FloatField(blank=True, null=True) z = models.FloatField(blank=True, null=True) + entrance = models.ForeignKey("Entrance", blank=True, null=True, on_delete=models.SET_NULL) class Meta: ordering = ("id",) |