diff options
Diffstat (limited to 'core/views/other.py')
-rw-r--r-- | core/views/other.py | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/core/views/other.py b/core/views/other.py index 639ea5f..9a12b1d 100644 --- a/core/views/other.py +++ b/core/views/other.py @@ -41,11 +41,15 @@ def todos(request, module): ''' from troggle.core.TESTS.tests import todo as tests from troggle.core.views.logbooks import todo as viewlogbooks + from troggle.parsers.logbooks import todo as parserslogbooks from troggle.core.forms import todo as forms + from troggle.core.templatetags.wiki_markup import todo as wiki tododict = {'views/other': todo, 'tests': tests, 'views/logbooks': viewlogbooks, - 'core/forms': forms} + 'parsers/logbooks': parserslogbooks, + 'core/forms': forms, + 'core/templatetags/wiki_markup': wiki} return render(request,'core/todos.html', {'tododict': tododict}) def troggle404(request): # cannot get this to work. Handler404 in urls.py not right syntax @@ -215,25 +219,25 @@ def newfile(request, pslug = None): return render(request, 'editfile.html', {'fileForm': fileform, }) @login_required_if_public -def simpleupload(request): - print(f'! - FORM simpleupload - start') +def scanupload(request, year='2050'): + print(f'! - FORM scanupload - start') if request.method == 'POST': form = SimpleUploadFileForm(request.POST,request.FILES) if form.is_valid(): #form.save() # comment out so nothing saved in MEDIA_ROOT/fileuploads f = request.FILES["simplefile"] w = request.POST["title"] - print(f'! - FORM simpleupload uploaded {f.name}') - fs = FileSystemStorage(os.path.join(settings.SURVEY_SCANS, '2021', w)) + print(f'! - FORM scanupload uploaded {f.name}') + fs = FileSystemStorage(os.path.join(settings.SURVEY_SCANS, year, w)) actual_saved = fs.save(f.name, content=f) # name may chnage to avoid clash - # INSERT check if name is chnaged, to allow user to abort and rename - or lets do a chaecjk anyway. + # INSERT check if name is changed, to allow user to abort and rename - or lets do a chaecjk anyway. - print(f'! - FORM simpleupload {actual_saved}') + print(f'! - FORM scanupload {actual_saved}') form = SimpleUploadFileForm() - return render(request, 'simpleupload.html', {'form': form,'filesaved': True, 'actual_saved': actual_saved}) + return render(request, 'scanuploadform.html', {'form': form,'filesaved': True, 'actual_saved': actual_saved}) else: form = SimpleUploadFileForm() - return render(request, 'simpleupload.html', {'form':form,}) + return render(request, 'scanuploadform.html', {'form':form,}) |