mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-18 12:57:09 +00:00
fixed bug from people who did not turn up, optimised parsing a bit
This commit is contained in:
@@ -144,10 +144,16 @@ class Person(TroggleModel):
|
||||
return sum([personexpedition.surveyedleglength() for personexpedition in self.personexpedition_set.all()])
|
||||
|
||||
def first(self):
|
||||
return self.personexpedition_set.order_by("-expedition")[0]
|
||||
if self.personexpedition_set.order_by("-expedition"):
|
||||
return self.personexpedition_set.order_by("-expedition")[0]
|
||||
else:
|
||||
return None
|
||||
|
||||
def last(self):
|
||||
return self.personexpedition_set.order_by("expedition")[0]
|
||||
if self.personexpedition_set.order_by("expedition"):
|
||||
return self.personexpedition_set.order_by("expedition")[0]
|
||||
else:
|
||||
return None
|
||||
|
||||
# moved from personexpedition
|
||||
def name(self):
|
||||
|
||||
@@ -680,22 +680,24 @@ def read_cave(filename, mvf=None, cave=None):
|
||||
else:
|
||||
# print(f"eslug {eslug} looking up entrance ")
|
||||
try:
|
||||
entrance_count = Entrance.objects.filter(slug=eslug).count()
|
||||
entrance_e = Entrance.objects.filter(slug=eslug)
|
||||
except:
|
||||
message = f"! Fail entrance count {eslug}. {entrance_count=}"
|
||||
print(message)
|
||||
if entrance_count == 1:
|
||||
entrance = Entrance.objects.get(slug=eslug)
|
||||
if entrance_e.count() == 1:
|
||||
entrance = entrance_e[0]
|
||||
# entrance = Entrance.objects.get(slug=eslug)
|
||||
entrances_xslug[eslug] = entrance
|
||||
else:
|
||||
message = f"! Entrance count {entrance_count=} for {eslug}. "
|
||||
message = f"! Entrance count {entrance_e.count()=} for {eslug}. "
|
||||
print(message)
|
||||
eslug = eslug[:-1] + eslug[-1].upper()
|
||||
entrance_count = Entrance.objects.filter(slug=eslug).count()
|
||||
message = f"! Entrance count {entrance_count=} for uppercase variant {eslug}. "
|
||||
entrance_e = Entrance.objects.filter(slug=eslug)
|
||||
message = f"! Entrance count {entrance_e.count()=} for uppercase variant {eslug}. "
|
||||
print(message)
|
||||
if entrance_count == 1:
|
||||
entrance = Entrance.objects.get(slug=eslug)
|
||||
if entrance_e.count() == 1:
|
||||
entrance = entrance_e[0]
|
||||
# entrance = Entrance.objects.get(slug=eslug)
|
||||
entrances_xslug[eslug] = entrance
|
||||
message = f"! Warning entrance loading {eslug} only exists as upper case variant "
|
||||
DataIssue.objects.create(parser="entrances", message=message, url=f"{cave.url}_cave_edit/")
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
{% endfor %}
|
||||
</table>
|
||||
<p>This is based purely on attendance, not on activities, surveying or usefulness of any kind.
|
||||
But as Woody Allen said: "90% of success is just turning up".
|
||||
But as Woody Allen said: "80% of success is showing up".
|
||||
This is mostly people who have been within the past three years, with an additional bias for number of attendances since 1976.
|
||||
The metric is just a geometric "recency" (1/2 for attending last year, 1/3 for the year before, etc., added up.)
|
||||
The display cuttoff is 1/3 so if you came just once, three years ago, you are on the list.
|
||||
|
||||
Reference in New Issue
Block a user