summaryrefslogtreecommitdiffstats
path: root/core/views/scans.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2022-07-27 23:22:46 +0300
committerPhilip Sargent <philip.sargent@klebos.com>2022-07-27 23:24:51 +0300
commitc39fb3070789c19b870603434560e523166abad4 (patch)
tree6f5f1ff1f3aa9ef9cd914fb038f3d4029d39e8e0 /core/views/scans.py
parent91568b71516c6418bd9e2bd00433486bc6baf769 (diff)
downloadtroggle-c39fb3070789c19b870603434560e523166abad4.tar.gz
troggle-c39fb3070789c19b870603434560e523166abad4.tar.bz2
troggle-c39fb3070789c19b870603434560e523166abad4.zip
new urls and dummy functions and rename
Diffstat (limited to 'core/views/scans.py')
-rw-r--r--core/views/scans.py23
1 files changed, 21 insertions, 2 deletions
diff --git a/core/views/scans.py b/core/views/scans.py
index 770b925..61d988e 100644
--- a/core/views/scans.py
+++ b/core/views/scans.py
@@ -20,7 +20,26 @@ by looking inside the file before being served.
need to check if inavlid query string is invalid, or produces multiple replies
and render a user-friendly error page.
'''
-
+
+
+def walletslistyear(request, year):
+ '''Page which displays a list of all the wallets in a specific year
+ '''
+ if year < 1976 or year > 2050:
+ return render(request, 'errors/generic.html', {'message': 'Year out of range. Must be between 1976 and 2050'})
+ else:
+ year = str(year)
+ return render(request, 'errors/generic.html', {'message': 'not implemented yet'})
+
+def walletslistcave(request, caveid):
+ '''Page which displays a list of all the wallets attached to a specific cave, e.g. '1623-204'
+ '''
+ g = GetCaveLookup()
+ if caveid not in g:
+ return render(request, 'errors/generic.html', {'message': f'Cave identifier not recognised:"{caveid}"'})
+
+ return render(request, 'errors/generic.html', {'message': 'not implemented yet'})
+
def oldwallet(request, path):
'''Now called only for non-standard wallet structures for pre-2000 wallets
'''
@@ -59,7 +78,7 @@ def scansingle(request, path, file):
return render(request, 'errors/generic.html', {'message': message})
-def allwallets(request):
+def allscans(request):
'''Returns all the wallets in the system, we would like to use
the Django queryset SQL optimisation https://docs.djangoproject.com/en/3.2/ref/models/querysets/#prefetch-related
to get the related singlescan and survexblock objects but that requires rewriting this to do the query on those, not on