diff options
Diffstat (limited to 'core/views/survex.py')
-rw-r--r-- | core/views/survex.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/core/views/survex.py b/core/views/survex.py index 7ac206a..bd9df25 100644 --- a/core/views/survex.py +++ b/core/views/survex.py @@ -645,23 +645,30 @@ def survexcaveslist(request): def survexdir(request): """report on all the SurvexDirectory objects We are trying to find out how mismatches have crept in. + and whether the whole SUrvexDirectory class is actually redundant + as the info it holds is always embedded in the survexFile path directories """ - sds = SurvexDirectory.objects.all().order_by("cave") + sds = SurvexDirectory.objects.all() #.order_by("cave") for sd in sds: sd.primarybad = True if f"{sd.primarysurvexfile}".startswith(str(sd.path)): sd.primarybad = False - sd.cavebad = True - munge = f"caves-{sd.cave}".lower() - if str(sd.path).lower().replace("/","-").startswith(munge): - sd.cavebad = False + # sd.cavebad = True + # munge = f"caves-{sd.cave}".lower() + # if str(sd.path).lower().replace("/","-").startswith(munge): + # sd.cavebad = False sd.pathbad = True if Path(settings.SURVEX_DATA, f"{sd.primarysurvexfile}.svx").is_file(): sd.pathbad = False - return render(request, "survexdir.html", {"survexdirs": sds}) + + survexfiles = SurvexFile.objects.all().order_by("cave") + # for f in survexfiles: + # if f.cave: + # print(f, f.cave) + return render(request, "survexdir.html", {"survexdirs": sds, "survexfiles": survexfiles}) def survexcavesingle(request, survex_cave): |