summaryrefslogtreecommitdiffstats
path: root/core/models/caves.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2022-11-23 10:48:39 +0000
committerPhilip Sargent <philip.sargent@klebos.com>2022-11-23 10:48:39 +0000
commitb06d1dae4222cdb6e50fef629967bc76625b52e9 (patch)
tree5526634dc2d0c3097e27f611da23fcafd5197f32 /core/models/caves.py
parent45a640dfe9aa5da411992668273e525ee6150b4b (diff)
downloadtroggle-b06d1dae4222cdb6e50fef629967bc76625b52e9.tar.gz
troggle-b06d1dae4222cdb6e50fef629967bc76625b52e9.tar.bz2
troggle-b06d1dae4222cdb6e50fef629967bc76625b52e9.zip
Convert.format() to f-strings with flynt
Diffstat (limited to 'core/models/caves.py')
-rw-r--r--core/models/caves.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/core/models/caves.py b/core/models/caves.py
index 98b4832..30a4a0b 100644
--- a/core/models/caves.py
+++ b/core/models/caves.py
@@ -144,9 +144,9 @@ class Cave(TroggleModel):
def reference(self):
if self.kataster_number:
- return "%s-%s" % (self.kat_area(), self.kataster_number)
+ return f"{self.kat_area()}-{self.kataster_number}"
else:
- return "%s-%s" % (self.kat_area(), self.unofficial_number)
+ return f"{self.kat_area()}-{self.unofficial_number}"
def get_absolute_url(self):
if self.kataster_number:
@@ -332,21 +332,21 @@ class Entrance(TroggleModel):
if self.tag_station:
try:
s = SurvexStation.objects.lookup(self.tag_station)
- return r + "%0.0fE %0.0fN %0.0fAlt" % (s.x, s.y, s.z)
+ return r + f"{s.x:0.0f}E {s.y:0.0f}N {s.z:0.0f}Alt"
except:
- return r + "%s Tag Station not in dataset" % self.tag_station
+ return r + f"{self.tag_station} Tag Station not in dataset"
if self.exact_station:
try:
s = SurvexStation.objects.lookup(self.exact_station)
- return r + "%0.0fE %0.0fN %0.0fAlt" % (s.x, s.y, s.z)
+ return r + f"{s.x:0.0f}E {s.y:0.0f}N {s.z:0.0f}Alt"
except:
- return r + "%s Exact Station not in dataset" % self.tag_station
+ return r + f"{self.tag_station} Exact Station not in dataset"
if self.other_station:
try:
s = SurvexStation.objects.lookup(self.other_station)
- return r + "%0.0fE %0.0fN %0.0fAlt %s" % (s.x, s.y, s.z, self.other_description)
+ return r + f"{s.x:0.0f}E {s.y:0.0f}N {s.z:0.0f}Alt {self.other_description}"
except:
- return r + "%s Other Station not in dataset" % self.tag_station
+ return r + f"{self.tag_station} Other Station not in dataset"
if self.FINDABLE_CHOICES == "S":
r += "ERROR, Entrance has been surveyed but has no survex point"
if self.bearings: