summaryrefslogtreecommitdiffstats
path: root/core/models.py
diff options
context:
space:
mode:
authorSam Wenham <sam@wenhams.co.uk>2019-03-09 18:21:10 +0000
committerSam Wenham <sam@wenhams.co.uk>2019-03-09 18:21:10 +0000
commitb4296f1736a4ab464ef4bdc3662693b14a966443 (patch)
tree7a1207160143422086bcc8c5f2efec1d491375ae /core/models.py
parent1bac650aeeb7db415df82a9dda7a457f451856d4 (diff)
downloadtroggle-b4296f1736a4ab464ef4bdc3662693b14a966443.tar.gz
troggle-b4296f1736a4ab464ef4bdc3662693b14a966443.tar.bz2
troggle-b4296f1736a4ab464ef4bdc3662693b14a966443.zip
Fix people list
Cope with Jimmy McFoo as a name! Don't set the top expo value in the code whin it is piss easy to calculate Fix typo from last commit
Diffstat (limited to 'core/models.py')
-rw-r--r--core/models.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/models.py b/core/models.py
index 8cc91ea..1b2875a 100644
--- a/core/models.py
+++ b/core/models.py
@@ -151,9 +151,15 @@ class Person(TroggleModel):
def notability(self):
notability = Decimal(0)
+ max_expo_val = 0
+
+ max_expo_year = Expedition.objects.all().aggregate(Max('year'))
+ max_expo_val = int(max_expo_year['year__max']) + 1
+
for personexpedition in self.personexpedition_set.all():
if not personexpedition.is_guest:
- notability += Decimal(1) / (2012 - int(personexpedition.expedition.year))
+ print(personexpedition.expedition.year)
+ notability += Decimal(1) / (max_expo_val - int(personexpedition.expedition.year))
return notability
def bisnotable(self):