diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/models.py | 4 | ||||
-rw-r--r-- | core/views_logbooks.py | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/core/models.py b/core/models.py index 4d69481..9414e58 100644 --- a/core/models.py +++ b/core/models.py @@ -157,7 +157,7 @@ class Person(TroggleModel): notability = Decimal(0) max_expo_val = 0 - max_expo_year = Expedition.objects.all().aggregate(Max('year')) + max_expo_year = Expedition.objects.all().aggregate(models.Max('year')) max_expo_val = int(max_expo_year['year__max']) + 1 for personexpedition in self.personexpedition_set.all(): @@ -232,7 +232,7 @@ class PersonExpedition(TroggleModel): return res["day_min"] def day_max(self): - res = self.persontrip_set.all().aggregate(day_max=Max("expeditionday__date")) + res = self.persontrip_set.all().aggregate(day_max=models.Max("expeditionday__date")) return res["day_max"] diff --git a/core/views_logbooks.py b/core/views_logbooks.py index 1cb9f2c..53333fb 100644 --- a/core/views_logbooks.py +++ b/core/views_logbooks.py @@ -3,6 +3,7 @@ import os.path import re import django.db.models +from django.db.models import Min, Max from django.core.urlresolvers import reverse from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render, render_to_response @@ -49,7 +50,7 @@ def personindex(request): # From what I can tell, "persons" seems to be the table rows, while "personss" is the table columns. - AC 16 Feb 09 personss = [ ] ncols = 4 - nc = (len(persons) + ncols - 1) / ncols + nc = int((len(persons) + ncols - 1) / ncols) for i in range(ncols): personss.append(persons[i * nc: (i + 1) * nc]) |