summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2022-07-17 16:08:01 +0300
committerPhilip Sargent <philip.sargent@klebos.com>2022-07-17 16:08:01 +0300
commit145540caf5344fe5c1da9b9a3924603df9d3afb1 (patch)
tree8d93d18920a799c09d7ad1935de0a873c9b331c9
parentb7035f1574d8a4c684f74a1252141ed1f2ca2b59 (diff)
downloadtroggle-145540caf5344fe5c1da9b9a3924603df9d3afb1.tar.gz
troggle-145540caf5344fe5c1da9b9a3924603df9d3afb1.tar.bz2
troggle-145540caf5344fe5c1da9b9a3924603df9d3afb1.zip
more weirdness in circumventing MariaDB/Django misunderstandings
-rw-r--r--parsers/survex.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/parsers/survex.py b/parsers/survex.py
index bd05010..e1e017a 100644
--- a/parsers/survex.py
+++ b/parsers/survex.py
@@ -1448,11 +1448,11 @@ def MakeSurvexFileRoot():
"""
# find a cave, any cave..
caves = Cave.objects.all()
- smk = caves.filter(kataster_number="000")
+ smk = caves.filter(kataster_number="000") # returns a list, a QuerySet
fileroot = SurvexFile(path=settings.SURVEX_TOPNAME, cave=None)
fileroot.save()
- directoryroot = SurvexDirectory(path=settings.SURVEX_DATA, cave=smk, primarysurvexfile=fileroot)
+ directoryroot = SurvexDirectory(path=settings.SURVEX_DATA, cave=smk[0], primarysurvexfile=fileroot)
# MariaDB doesn't like this hack. Complains about non-null cave_id EVEN THOUGH our model file says this is OK:
# cave = models.ForeignKey('Cave', blank=True, null=True,on_delete=models.SET_NULL)
directoryroot.save()