2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-15 00:47:12 +00:00

exploring recusrive behaviour

This commit is contained in:
Philip Sargent
2020-06-24 02:33:43 +01:00
parent 6bf762b72f
commit dc5a53376d
2 changed files with 8 additions and 5 deletions

View File

@@ -203,11 +203,9 @@ class Cave(TroggleModel):
def getCaveByReference(reference):
areaname, code = reference.split("-", 1)
#print(areaname, code)
area = Area.objects.get(short_name = areaname)
#print(area)
foundCaves = list(Cave.objects.filter(area = area, kataster_number = code).all()) + list(Cave.objects.filter(area = area, unofficial_number = code).all())
print((list(foundCaves)))
#print((list(foundCaves)))
if len(foundCaves) == 1:
return foundCaves[0]
else: