diff options
Diffstat (limited to 'core/views/survex.py')
-rw-r--r-- | core/views/survex.py | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/core/views/survex.py b/core/views/survex.py index d916e56..7267414 100644 --- a/core/views/survex.py +++ b/core/views/survex.py @@ -18,7 +18,7 @@ from django.views.decorators.csrf import ensure_csrf_cookie import troggle.settings as settings from troggle.core.models.logbooks import LogbookEntry from troggle.core.models.caves import Cave, GetCaveLookup -from troggle.core.models.survex import SurvexFile, SurvexBlock, SurvexDirectory +from troggle.core.models.survex import SurvexFile, SurvexBlock #, SurvexDirectory from troggle.core.models.wallets import Wallet from troggle.core.utils import only_commit from troggle.parsers.survex import parse_one_file @@ -654,27 +654,19 @@ def survexdir(request): as the info it holds is always embedded in the survexFile path directories """ - sds = SurvexDirectory.objects.all() #.order_by("cave") - for sd in sds: - sd.matchbad = True - if f"{sd.primarysurvexfile}".startswith(str(sd.path)): - sd.matchbad = False + # sds = SurvexDirectory.objects.all() #.order_by("cave") + sds ={} + # for sd in sds: + # sd.matchbad = True + # if f"{sd.primarysurvexfile}".startswith(str(sd.path)): + # sd.matchbad = False - sd.pathbad = True - if Path(settings.SURVEX_DATA, f"{sd.primarysurvexfile}.svx").is_file(): - sd.pathbad = False + # sd.pathbad = True + # if Path(settings.SURVEX_DATA, f"{sd.primarysurvexfile}.svx").is_file(): + # sd.pathbad = False survexfiles = SurvexFile.objects.all().order_by("cave") for f in survexfiles: - if f.survexdirectory: - f.matchbad = True - if f"{f.path}".startswith(str(f.survexdirectory.path)): - f.matchbad = False - f.primarybad = True - if f.primary: - f.pathparent = Path(f.primary.path).parent - if str(f.survexdirectory.path) == str(f.pathparent): - f.primarybad = False f.pathbad = True if Path(settings.SURVEX_DATA, f"{f.path}.svx").is_file(): f.pathbad = False |