diff --git a/core/views/statistics.py b/core/views/statistics.py index 7bf6520..78d0b6a 100644 --- a/core/views/statistics.py +++ b/core/views/statistics.py @@ -328,6 +328,23 @@ def stations(request): return render(request, "stations.html", {"ents": ents, "gpsents": gpsents, "stations": stations, "year": current_expo()}) +def old_key(p): + """This function goes into a lexicographic sort function, and the values are strings, + but we want to sort numerically. + Skip people who have never been on expo. + """ + last = p.last() + if last: + if last.expedition: + # print(p,p.last().expedition) + return int(p.last().expedition.year) + else: + print(p,p.last()) + + else: + print(f"{p} never attended expo") + return 2050 + def aliases(request, year): """Page which displays a list of all the person aliases in a specific year""" @@ -337,13 +354,17 @@ def aliases(request, year): 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 = list(Person.objects.all().order_by("last_name")) + + + oldpersons = persons + oldpersons.sort(key=old_key) + print(len(oldpersons)) aliases = GetPersonExpeditionNameLookup(expo) aliasdict = {} for i in sorted(aliases): aliasdict[i] = aliases[i] - invert = {} return render( request, @@ -352,8 +373,8 @@ def aliases(request, year): "year": year, "aliasdict": aliasdict, "foreign_friends": foreign_friends, - "invert": invert, "personexpeditions": personexpeditions, "persons": persons, + "oldpersons": oldpersons, }, ) diff --git a/templates/aliases.html b/templates/aliases.html index 43afbc0..3fe153e 100644 --- a/templates/aliases.html +++ b/templates/aliases.html @@ -26,21 +26,24 @@ td { {% endfor %} +

This is the list of people on expo this year. - -{% for key, value in invert.items %} - - - + +{% for pe in personexpeditions %} + + + + {% endfor %}
whoaliases
{{key}}{{value}}
Personmugshotblurbfile
{{pe.person}}{% if pe.person.mugshot %}{{pe.person.mugshot}}{% endif %}{% if pe.person.blurbfile %}{{pe.person.blurbfile}}{% endif %}

The aliases below are specified in the folk.csv file. Only one alias is possible in that format. The specified alias ('nickname') -is used in the table above to construct possible unambiguous identifiers. +is used in the table above to construct possible unambiguous identifiers. This is ordered by the date of last appearance on expo. + -{% for p in persons %} +{% for p in oldpersons %} @@ -53,17 +56,7 @@ is used in the table above to construct possible unambiguous identifiers. {% endfor %}
FirstLastFull nameNicknameexpo firstexpo last
{{p.first_name}} {{p.last_name}}
-

This is the list of people on expo this year. - - -{% for pe in personexpeditions %} - - - - - -{% endfor %} -
Personmugshotblurbfile
{{pe.person}}{% if pe.person.mugshot %}{{pe.person.mugshot}}{% endif %}{% if pe.person.blurbfile %}{{pe.person.blurbfile}}{% endif %}
+

And these are people known to us, who appear as survex *team members or in logbook participant lists, but are not expo members and so are not managed or reported: