mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2024-11-21 23:01:52 +00:00
re-enable lookup() on survexblock objects (again)
This commit is contained in:
parent
e71939fe00
commit
301fa1fce1
@ -82,7 +82,7 @@ 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)
|
||||
objects = SurvexStationLookUpManager() # overwrites SurvexStation.objects
|
||||
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)
|
||||
@ -121,7 +121,7 @@ class SurvexBlockLookUpManager(models.Manager):
|
||||
blocknames = []
|
||||
else:
|
||||
blocknames = name.split(".")
|
||||
# block = SurvexBlock.objects.get(parent=None, survexfile__path=settings.SURVEX_TOPNAME)
|
||||
block = SurvexBlock.objects.get(parent=None, survexfile__path=settings.SURVEX_TOPNAME)
|
||||
for blockname in blocknames:
|
||||
block = SurvexBlock.objects.get(parent=block, name__iexact=blockname)
|
||||
return block
|
||||
@ -132,7 +132,7 @@ class SurvexBlock(models.Model):
|
||||
Multiple anonymous survex blocks are possible within the same surfex file
|
||||
"""
|
||||
|
||||
# objects = SurvexBlockLookUpManager()
|
||||
objects = SurvexBlockLookUpManager() # overwrites SurvexBlock.objects and enables lookup()
|
||||
name = models.CharField(max_length=100)
|
||||
title = models.CharField(max_length=200)
|
||||
parent = models.ForeignKey("SurvexBlock", blank=True, null=True, on_delete=models.SET_NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user