aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dbstore')
-rw-r--r--dbstore/peewee_store.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/dbstore/peewee_store.py b/dbstore/peewee_store.py
index 00897d7..89e4b4b 100644
--- a/dbstore/peewee_store.py
+++ b/dbstore/peewee_store.py
@@ -52,14 +52,13 @@ def get_poi_by_fsq_id(fsq_id) -> dict:
52 return {} 52 return {}
53 53
54 54
55def create_poi(poi: dict): 55def create_or_update_poi(poi: dict) -> int:
56 with db.connection_context(): 56 with db.connection_context():
57 poi = Location.create( 57 return Location.insert(
58 fsq_id=poi["fsq_id"], 58 fsq_id=poi["fsq_id"],
59 name=poi["name"], 59 name=poi["name"],
60 locality=poi["locality"], 60 locality=poi["locality"],
61 region=poi["region"], 61 region=poi["region"],
62 latitude=poi["latitude"], 62 latitude=poi["latitude"],
63 longitude=poi["longitude"], 63 longitude=poi["longitude"],
64 ) 64 ).on_conflict_replace().execute()
65 poi.save()
Powered by cgit v1.2.3 (git 2.41.0)