From 4a33ea9d2c82c5fdcd29fc4f54fbb141c673b4d7 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Thu, 18 Jun 2020 10:52:00 +0200 Subject: Fix imports --- opendc/util/database.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'opendc/util') diff --git a/opendc/util/database.py b/opendc/util/database.py index 9b570d0d..20006ff2 100644 --- a/opendc/util/database.py +++ b/opendc/util/database.py @@ -4,7 +4,7 @@ import sys from datetime import datetime from pymongo import MongoClient from bson.json_util import loads, dumps, RELAXED_JSON_OPTIONS, CANONICAL_JSON_OPTIONS - +import urllib.parse #from mysql.connector.pooling import MySQLConnectionPool @@ -122,7 +122,7 @@ def fetchall(query, collection): results = [] cursor = prefabs_collection.find(query) for doc in cursor: - json_string = dumps(bson) #convert BSON representation to JSON + json_string = dumps(doc) #convert BSON representation to JSON json_obj = json.loads(json_string) #load as a JSON object #leave the id field in for now, we can use it later #json_obj.pop("_id") -- cgit v1.2.3