renamed to uploadfiles

This commit is contained in:
Philip Sargent 2021-05-04 20:56:44 +01:00
parent dc3379c186
commit b3fcd7765e
3 changed files with 15 additions and 5 deletions

View File

@ -32,6 +32,9 @@ todo = '''
so this is only a tool for a first pass, to be followed by extensive hand-editing! so this is only a tool for a first pass, to be followed by extensive hand-editing!
When we have done all the old logbooks, delete this function and the two templates. When we have done all the old logbooks, delete this function and the two templates.
-Do GIT stuff for upload forms
-Move upload forms to proper file locations
''' '''
def todos(request, module): def todos(request, module):
@ -41,8 +44,10 @@ def todos(request, module):
from troggle.core.TESTS.tests import todo as tests from troggle.core.TESTS.tests import todo as tests
from troggle.core.views.logbooks import todo as viewlogbooks from troggle.core.views.logbooks import todo as viewlogbooks
from troggle.core.views.survex import todo as viewsurvex from troggle.core.views.survex import todo as viewsurvex
from troggle.core.views.drawings import todo as viewdrawings
from troggle.parsers.caves import todo as parserscaves from troggle.parsers.caves import todo as parserscaves
from troggle.parsers.logbooks import todo as parserslogbooks from troggle.parsers.logbooks import todo as parserslogbooks
from troggle.parsers.drawings import todo as parsersdrawings
from troggle.parsers.survex import todo as parserssurvex from troggle.parsers.survex import todo as parserssurvex
from troggle.core.models.caves import todo as modelcaves from troggle.core.models.caves import todo as modelcaves
from troggle.core.middleware import todo as middleware from troggle.core.middleware import todo as middleware
@ -51,8 +56,10 @@ def todos(request, module):
'tests': tests, 'tests': tests,
'views/logbooks': viewlogbooks, 'views/logbooks': viewlogbooks,
'views/survex': viewsurvex, 'views/survex': viewsurvex,
'views/drawings': viewdrawings,
'parsers/caves': parserscaves, 'parsers/caves': parserscaves,
'parsers/logbooks': parserslogbooks, 'parsers/logbooks': parserslogbooks,
'parsers/drawings': parsersdrawings,
'parsers/survex': parserssurvex, 'parsers/survex': parserssurvex,
'core/models/caves': modelcaves, 'core/models/caves': modelcaves,
'core/middleware': middleware, 'core/middleware': middleware,
@ -195,7 +202,7 @@ def exportlogbook(request,year=None,extension=None):
class FilesForm(forms.Form): # not a model-form, just a form-form class FilesForm(forms.Form): # not a model-form, just a form-form
scanfiles = forms.FileField() uploadfiles = forms.FileField()
@login_required_if_public @login_required_if_public
def scanupload(request, wallet=None): def scanupload(request, wallet=None):
@ -312,6 +319,11 @@ def dwgupload(request, folder=None):
# print(f'! - FORM dwgupload multiple {actual_saved}') # print(f'! - FORM dwgupload multiple {actual_saved}')
filesaved = True filesaved = True
# DO GIT STUFF & load into Database too
# parsers.surveys.SetTunnelfileInfo(dwgfile) # commented out
# dwgfile.save()
files = [] files = []
dirs = [] dirs = []
#print(f'! - FORM dwgupload - start {folder} \n"{dirpath}" \n"{dirpath.parent}" \n"{dirpath.exists()}"') #print(f'! - FORM dwgupload - start {folder} \n"{dirpath}" \n"{dirpath.parent}" \n"{dirpath.exists()}"')

View File

@ -11,8 +11,7 @@
{% csrf_token %} {% csrf_token %}
<br> <br>
<input class="fancybutton" type = "file" multiple="multiple" <input class="fancybutton" type = "file" multiple="multiple"
placeholder = "Scanfiles" name = "scanfiles" id="scanfiles" /> name = "uploadfiles" id="uploadfiles" />
<br><br><br> <br><br><br>
<button class="fancybutton" style="padding: 0.5em 25px; margin-left: 155px" type = "submit" value = "Upload" > <button class="fancybutton" style="padding: 0.5em 25px; margin-left: 155px" type = "submit" value = "Upload" >
Upload Upload

View File

@ -20,8 +20,7 @@
{% csrf_token %} {% csrf_token %}
<br> <br>
<input class="fancybutton" type = "file" multiple="multiple" <input class="fancybutton" type = "file" multiple="multiple"
placeholder = "Scanfiles" name = "scanfiles" id="scanfiles" /> name = "uploadfiles" id="uploadfiles" />
<br><br><br> <br><br><br>
<button class="fancybutton" style="padding: 0.5em 25px; margin-left: 155px" type = "submit" value = "Upload" > <button class="fancybutton" style="padding: 0.5em 25px; margin-left: 155px" type = "submit" value = "Upload" >
Upload Upload