links to other years wallets

This commit is contained in:
Philip Sargent 2022-10-18 23:28:38 +03:00
parent 830150ade6
commit 2cafa32c7e
2 changed files with 10 additions and 3 deletions

View File

@ -269,5 +269,6 @@ def allscans(request):
'''
manywallets = Wallet.objects.all() # NB all of them
# manywallets = Wallet.objects.all().prefetch_related('singlescan') fails as the link is defined on 'singlescan' not on 'wallet'
return render(request, 'manywallets.html', { 'manywallets':manywallets, 'settings': settings })
expeditions = Expedition.objects.all()
return render(request, 'manywallets.html', { 'manywallets':manywallets, 'settings': settings, 'expeditions': expeditions })

View File

@ -13,10 +13,16 @@ traced to produce Tunnel or Therion drawings and eventually the final complete c
otherwise they come from *ref statements in survex files as of the most recent data import.
<p>See also wallets
<ul>
<li>per year, e.g. <a href="/wallets/year/2018">2018</a>, <a href="/wallets/year/2019">2019</a>, <a href="/wallets/year/2022">2022</a>
<li>per cave, e.g. <a href="/cave/scans/1623-161">1623-161</a>, <a href="/cave/scans/1626-359">1626-359</a>, <a href="/cave/scans/1623-290">1623-290</a>, <a href="/cave/scans/1623-291">1623-291</a>, <a href="/cave/scans/1623-264">1623-264</a>
<li>per person, e.g. <a href="/wallets/person/Wookey">Wookey</a>, <a href="/wallets/person/ChrisDensham">Chris Densham</a>, <a href="/wallets/person/BeckaLawson">Becka</a>
</ul>
<li>per year,
{% for otherexpedition in expeditions %}
{% if otherexpedition == expedition %}
| <b>{{otherexpedition.year}}</b>
{% else %}
| <a <a href="/wallets/year/{{ otherexpedition.year }}">{{otherexpedition.year}}</a>
{% endif %}
{% endfor %}</ul>
<!-- This should all be restructured to use .prefetch_related() and .select_related()
see https://docs.djangoproject.com/en/3.2/ref/models/querysets/#prefetch-related