diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2022-07-08 22:19:07 +0300 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2022-07-08 22:19:07 +0300 |
commit | 9803ebe2e807aedc9d19dbd68b320ec27a7e37fd (patch) | |
tree | 74e22e54d4323c4ed30bc9ec7219806c2e5d646a | |
parent | ca5586fc4233a93ba93ee8d4a87ff63f3a0483c3 (diff) | |
download | troggle-9803ebe2e807aedc9d19dbd68b320ec27a7e37fd.tar.gz troggle-9803ebe2e807aedc9d19dbd68b320ec27a7e37fd.tar.bz2 troggle-9803ebe2e807aedc9d19dbd68b320ec27a7e37fd.zip |
fix bug in Area creation
-rw-r--r-- | parsers/caves.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/parsers/caves.py b/parsers/caves.py index 6b73c13..6c9d749 100644 --- a/parsers/caves.py +++ b/parsers/caves.py @@ -102,7 +102,7 @@ def do_pending_cave(k, url, area_1623): notes = default_note) if cave: cave.save() # must save to have id before foreign keys work. This is also a ManyToMany key. - cave.area.add(area_1623[0]) + cave.area.add(area_1623) cave.save() message = f" ! {k:12} {cave.underground_description}" DataIssue.objects.create(parser='caves', message=message, url=url) @@ -158,11 +158,10 @@ def readcaves(): DataIssue.objects.filter(parser='caves ok').delete() DataIssue.objects.filter(parser='entrances').delete() - area_1623 = Area.objects.update_or_create(short_name = "1623", parent = None) + area_1623, state = Area.objects.update_or_create(short_name = "1623", parent = None) # This seems to return a tuple, not a single object! i.e. (<Area: 1623>, True) #print(f' ! - READ CAVES: {area_1623}') - - area_1626 = Area.objects.update_or_create(short_name = "1626", parent = None) + area_1626, state = Area.objects.update_or_create(short_name = "1626", parent = None) print (" - Setting pending caves") # Do this first, so that these empty entries are overwritten as they get properly created. |