diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2020-05-31 22:35:36 +0100 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2020-05-31 22:35:36 +0100 |
commit | f949bb8dc0d5c5e6c37a5464a8e67d6c5fc8c254 (patch) | |
tree | 16c84d4c238e0bf6bbd209c5e87a3f70e58deb15 | |
parent | c863bf6e1defbf1bbe66d3be3d6bf57527ca6d22 (diff) | |
download | troggle-f949bb8dc0d5c5e6c37a5464a8e67d6c5fc8c254.tar.gz troggle-f949bb8dc0d5c5e6c37a5464a8e67d6c5fc8c254.tar.bz2 troggle-f949bb8dc0d5c5e6c37a5464a8e67d6c5fc8c254.zip |
python3 fixes for djsngo admin pages
-rw-r--r-- | core/models.py | 4 | ||||
-rw-r--r-- | core/views_logbooks.py | 3 | ||||
-rw-r--r-- | templates/frontpage.html | 2 |
3 files changed, 5 insertions, 4 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]) diff --git a/templates/frontpage.html b/templates/frontpage.html index c0aea50..a11b6f7 100644 --- a/templates/frontpage.html +++ b/templates/frontpage.html @@ -6,7 +6,7 @@ {% block related %} <h2>Recent Actions</h2> {% load log %} - {% get_admin_log 10 as admin_log %} + {% get_admin_log 10 as admin_log for_user 1 %} {% if not admin_log %} <p>No recent actions</p> {% else %} |