diff options
| author | Georgios Andreadis <info@gandreadis.com> | 2020-06-18 10:52:00 +0200 |
|---|---|---|
| committer | Georgios Andreadis <info@gandreadis.com> | 2020-06-18 10:52:00 +0200 |
| commit | 4a33ea9d2c82c5fdcd29fc4f54fbb141c673b4d7 (patch) | |
| tree | 48c1e7e2eb2f26f2dfefe45f0327869d5fe988e1 | |
| parent | d4c33e4893528fbd69943981472d00ba232d2ab3 (diff) | |
Fix imports
| -rw-r--r-- | opendc/util/database.py | 4 | ||||
| -rw-r--r-- | setup.py | 3 |
2 files changed, 4 insertions, 3 deletions
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") @@ -42,6 +42,7 @@ setup( 'flask-cors==3.0.8', 'pyasn1-modules==0.2.2', 'six==1.11.0', - 'pymongo==3.10.1' + 'pymongo==3.10.1', + 'bson==0.5.10' ], ) |
