diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2023-08-08 01:17:36 +0300 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2023-08-08 01:17:36 +0300 |
commit | 9e9c24ad44d9d2386b1dc99be52f48ba38b8f6d2 (patch) | |
tree | 714586639202e51ed1633465d652cfe8394535c2 /core/views/uploads.py | |
parent | b1a5251768f05b1bcc97f287501c9a50d57e309d (diff) | |
download | troggle-9e9c24ad44d9d2386b1dc99be52f48ba38b8f6d2.tar.gz troggle-9e9c24ad44d9d2386b1dc99be52f48ba38b8f6d2.tar.bz2 troggle-9e9c24ad44d9d2386b1dc99be52f48ba38b8f6d2.zip |
better placeholder/value setting
Diffstat (limited to 'core/views/uploads.py')
-rw-r--r-- | core/views/uploads.py | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/core/views/uploads.py b/core/views/uploads.py index 53c59cb..9b4b3fd 100644 --- a/core/views/uploads.py +++ b/core/views/uploads.py @@ -60,7 +60,6 @@ def logbookedit(request, year=None): """Type in a logbook entry. No editing yet, name is implying a future enhancement """ - author = "Zonker" if not year: year = 2023 @@ -72,14 +71,15 @@ def logbookedit(request, year=None): return render(request, "errors/generic.html", {"message": message}) else: # validation all to be done yet.. - author = request.POST["author"] - date = request.POST["date"] - others = request.POST["others"] - place = request.POST["place"] + date = request.POST["date"] # check valid and this year + author = request.POST["author"] # check against personexpedition + others = request.POST["others"] # check each against personexpedition + place = request.POST["place"] # no hyphens ! title = request.POST["title"] - entry = request.POST["text"] - tu = request.POST["tu"] - seq = 99 + entry = request.POST["text"] # replace 2 \n or <p> with <br><br> + tu = request.POST["tu"] # check numeric + seq = 99 # should match the number of entries on this date +1 in the db already + # OK this could be done by rendering a template, but for such a small bit of HTML, it is easier to have # it all in one place: here output = f''' @@ -95,7 +95,11 @@ def logbookedit(request, year=None): { "form": form, "year": year, - "author": author, + "date": date, + "place": place, + "title": title, + "tu": tu, + "entry": entry, "output": output, }, ) @@ -109,7 +113,6 @@ def logbookedit(request, year=None): { "form": form, "year": year, - "author": author, }, ) |