forked from expo/troggle
wallets now sorted as well as deduplicated
This commit is contained in:
parent
5161fce32e
commit
f895a7e44c
@ -72,13 +72,15 @@ def allwallets(request):
|
|||||||
def cavewallets(request, cave_id):
|
def cavewallets(request, cave_id):
|
||||||
'''Returns all the wallets for just one cave,
|
'''Returns all the wallets for just one cave,
|
||||||
'''
|
'''
|
||||||
|
|
||||||
Gcavelookup = GetCaveLookup()
|
Gcavelookup = GetCaveLookup()
|
||||||
if cave_id in Gcavelookup:
|
if cave_id in Gcavelookup:
|
||||||
cave = Gcavelookup[cave_id]
|
cave = Gcavelookup[cave_id]
|
||||||
else:
|
else:
|
||||||
return render(request,'errors/badslug.html', {'badslug': cave_id})
|
return render(request,'errors/badslug.html', {'badslug': cave_id})
|
||||||
|
|
||||||
print(f'cavewallets {cave_id=} {cave=}')
|
# remove duplication. SOrting is done in the template
|
||||||
|
wallets = set(Wallet.objects.filter(survexblock__survexfile__cave=cave))
|
||||||
|
manywallets = list(wallets)
|
||||||
|
|
||||||
manywallets = set(Wallet.objects.filter(survexblock__survexfile__cave=cave))
|
|
||||||
return render(request, 'cavewallets.html', { 'manywallets':manywallets, 'settings': settings, 'cave': cave})
|
return render(request, 'cavewallets.html', { 'manywallets':manywallets, 'settings': settings, 'cave': cave})
|
||||||
|
@ -12,7 +12,7 @@ traced to produce Tunnel or Therion drawings and eventually the final complete c
|
|||||||
|
|
||||||
<table width=95%>
|
<table width=95%>
|
||||||
<tr><th>Scans folder</th><th>Files</th><th>Survex blocks</th><th>Cave</th></tr>
|
<tr><th>Scans folder</th><th>Files</th><th>Survex blocks</th><th>Cave</th></tr>
|
||||||
{% for scanswallet in manywallets %}
|
{% for scanswallet in manywallets|dictsort:"walletname" %}
|
||||||
<tr>
|
<tr>
|
||||||
<td style="padding:2px"><a href="{{scanswallet.get_absolute_url}}">{{scanswallet.walletname}}</a></td>
|
<td style="padding:2px"><a href="{{scanswallet.get_absolute_url}}">{{scanswallet.walletname}}</a></td>
|
||||||
<td align="right" style="padding:2px">{{scanswallet.singlescan_set.all|length}}</td>
|
<td align="right" style="padding:2px">{{scanswallet.singlescan_set.all|length}}</td>
|
||||||
|
Loading…
Reference in New Issue
Block a user