summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2022-10-10 00:28:57 +0300
committerPhilip Sargent <philip.sargent@klebos.com>2022-10-10 00:28:57 +0300
commit8c8b6966a7d1e7ee1be5b2e4d8dfefcc3bf32410 (patch)
tree986ee77c9616a8ccdaa66c65bfaec90199e576c3
parent861980a8e9f9d58e6327e8e1a98f7f8c5fec7048 (diff)
downloadtroggle-8c8b6966a7d1e7ee1be5b2e4d8dfefcc3bf32410.tar.gz
troggle-8c8b6966a7d1e7ee1be5b2e4d8dfefcc3bf32410.tar.bz2
troggle-8c8b6966a7d1e7ee1be5b2e4d8dfefcc3bf32410.zip
sort output, accept more comma use
-rw-r--r--core/views/statistics.py7
-rw-r--r--parsers/survex.py2
2 files changed, 4 insertions, 5 deletions
diff --git a/core/views/statistics.py b/core/views/statistics.py
index 14205b7..56517d7 100644
--- a/core/views/statistics.py
+++ b/core/views/statistics.py
@@ -1,6 +1,7 @@
import datetime
import os.path
import re
+import operator
from collections import OrderedDict
import django.db.models
@@ -179,12 +180,10 @@ def aliases(request, year):
year = 1998
expo = Expedition.objects.filter(year=year)[0] # returns a set, even though we know there is only one
personexpeditions = PersonExpedition.objects.filter(expedition=expo)
- persons = Person.objects.all()
-
+ persons = list(Person.objects.all().order_by('last_name'))
+
aliases = GetPersonExpeditionNameLookup(expo)
- aliasdict = {key: val for key, val in sorted(aliases.items(), key = lambda ele: ele[0])}
-
aliasdict={}
for i in sorted(aliases):
aliasdict[i]=aliases[i]
diff --git a/parsers/survex.py b/parsers/survex.py
index cbd7704..ee9b5bc 100644
--- a/parsers/survex.py
+++ b/parsers/survex.py
@@ -126,7 +126,7 @@ class LoadingSurvex():
rx_teammem = re.compile(r"(?i)"+instruments+"?(?:es|s)?\s+(.*)$")
rx_teamold = re.compile(r"(?i)(.*)\s+"+instruments+"?(?:es|s)?$")
rx_teamabs = re.compile(r"(?i)^\s*("+instruments+")?(?:es|s)?\s*$")
- rx_person = re.compile(r"(?i) and |/| / |, | & | \+ |^both$|^none$")
+ rx_person = re.compile(r"(?i) and |/| / |, | , |&| & | \+ |^both$|^none$")
rx_qm = re.compile(r'(?i)^\s*QM(\d+)\s+?([a-dA-DxX])\s+([\w\-\_]+)\.([\w\.\-]+)\s+(([\w\-]+)\.([\w\.\-]+)|\-)\s+(.+)$')
# does not recognise non numeric suffix survey point ids
rx_qm0 = re.compile(r'(?i)^\s*QM(\d+)\s+(.+)$')