diff --git a/core/views/logbooks.py b/core/views/logbooks.py index 375ec6e..40d664c 100644 --- a/core/views/logbooks.py +++ b/core/views/logbooks.py @@ -226,22 +226,6 @@ def logbookentry(request, date, slug): print(msg) return render(request, 'errors/generic.html',{'message':msg}) -def logbookSearch(request, extra): - '''This uses Django free text search of a text field to find the list of logbook entries. - We need to create a search box form to set up the ?q=searchterms URL GET - This has not been touched since we were running on Django 1.11 and probably earlier.. - A better idea is just to delete it and rely on he full text search that Wookey did. - ''' - query_string = '' - found_entries = None - if ('q' in request.GET) and request.GET['q'].strip(): - query_string = request.GET['q'] - entry_query = search.get_query(query_string, ['text','title',]) - found_entries = LogbookEntry.objects.filter(entry_query) - - return render(request,'logbooksearch.html', - { 'query_string': query_string, 'found_entries': found_entries, }) - def get_people(request, expeditionslug): exp = Expedition.objects.get(year = expeditionslug) return render(request,'options.html', {"items": [(pe.slug, pe.name) for pe in exp.personexpedition_set.all()]}) diff --git a/urls.py b/urls.py index 59e0bf9..414b0ab 100644 --- a/urls.py +++ b/urls.py @@ -14,7 +14,7 @@ from troggle.core.views.uploads import dwgupload, scanupload, photoupload from troggle.core.views.other import troggle404, frontpage, todos, controlpanel, frontpage from troggle.core.views.other import exportlogbook from troggle.core.views.caves import ent, cavepage, caveindex, get_entrances, edit_cave, cave3d, caveEntrance, edit_entrance, caveQMs, qm -from troggle.core.views.logbooks import get_logbook_entries, logbookentry, logbookSearch +from troggle.core.views.logbooks import get_logbook_entries, logbookentry from troggle.core.views.logbooks import notablepersons, person, get_people from troggle.core.views.logbooks import expedition, personexpedition, Expeditions_tsvListView, Expeditions_jsonListView from troggle.core.views.prospect import prospecting_image @@ -113,14 +113,12 @@ trogglepatterns = [ # Logbook entries re_path(r'^logbookentry/(?P.*)/(?P.*)/?$', logbookentry,name="logbookentry"), - re_path(r'^logbooksearch/(.*)/?$', logbookSearch), # name 'search' not defined in views/logbooks.py re_path(r'^logbook(?P\d\d\d\d)\.(?P.*)/?$', exportlogbook, name='exportlogbook'), # e.g. /logbook2019.html # working but old CSS in re_path(r'^logbook$', exportlogbook, name='exportlogbook'), # Internal. editfile.html template uses these internally re_path(r'^getPeople/(?P.*)', get_people, name = "get_people"), re_path(r'^getLogBookEntries/(?P.*)', get_logbook_entries, name = "get_logbook_entries"), - #re_path(r'^getQMs/(?P.*)', get_qms, name = "get_qms"), # Not used anywhere ? re_path(r'^getEntrances/(?P.*)', get_entrances, name = "get_entrances"), # used internally ? # Cave description pages