mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2024-11-25 08:41:51 +00:00
python3 fixes for djsngo admin pages
This commit is contained in:
parent
c863bf6e1d
commit
f949bb8dc0
@ -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"]
|
||||
|
||||
|
||||
|
@ -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])
|
||||
|
||||
|
@ -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 %}
|
||||
|
Loading…
Reference in New Issue
Block a user