forked from expo/troggle
Remove unused field on survexstation class
This commit is contained in:
@@ -86,22 +86,23 @@ class SurvexStationLookUpManager(models.Manager):
|
||||
|
||||
class SurvexStation(models.Model):
|
||||
name = models.CharField(max_length=100)
|
||||
block = models.ForeignKey("SurvexBlock", null=True, on_delete=models.SET_NULL)
|
||||
# block = models.ForeignKey("SurvexBlock", null=True, on_delete=models.SET_NULL)
|
||||
# block not used since 2020. survex stations objects are only used for entrnce locations and all taken from the .3d file
|
||||
objects = SurvexStationLookUpManager() # overwrites SurvexStation.objects and enables lookup()
|
||||
x = models.FloatField(blank=True, null=True)
|
||||
y = models.FloatField(blank=True, null=True)
|
||||
z = models.FloatField(blank=True, null=True)
|
||||
|
||||
def path(self):
|
||||
r = self.name
|
||||
b = self.block
|
||||
while True:
|
||||
if b.name:
|
||||
r = b.name + "." + r
|
||||
if b.parent:
|
||||
b = b.parent
|
||||
else:
|
||||
return r
|
||||
# def path(self):
|
||||
# r = self.name
|
||||
# b = self.block
|
||||
# while True:
|
||||
# if b.name:
|
||||
# r = b.name + "." + r
|
||||
# if b.parent:
|
||||
# b = b.parent
|
||||
# else:
|
||||
# return r
|
||||
|
||||
class Meta:
|
||||
ordering = ("id",)
|
||||
|
||||
Reference in New Issue
Block a user