diff --git a/docker-compose.yml b/docker-compose.yml index d916b2f..1752f2d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,4 +17,4 @@ services: MONGO_INITDB_ROOT_USERNAME: mongo_user MONGO_INITDB_ROOT_PASSWORD: mongo_password ports: - - 27017:27017 # remove this line on prod + - 27018:27018 # remove this line on prod diff --git a/model-hub/app.py b/model-hub/app.py index ea9557f..295cc6c 100644 --- a/model-hub/app.py +++ b/model-hub/app.py @@ -6,7 +6,7 @@ app = Flask(__name__) app.config["MONGO_DBNAME"] = "modelhubdb" -app.config["MONGO_URI"] = "mongodb://localhost:27017/modelhubdb" +app.config["MONGO_URI"] = "mongodb://localhost:27018/modelhubdb" mongo = PyMongo(app) diff --git a/model_hub/db/impl/mongo_manager.py b/model_hub/db/impl/mongo_manager.py index 5f8c227..c9fc570 100644 --- a/model_hub/db/impl/mongo_manager.py +++ b/model_hub/db/impl/mongo_manager.py @@ -26,8 +26,9 @@ async def close_database_connection(self): async def get_models(self) -> List[Model]: models_list = [] models_q = self.db.models.find() - async for post in models_q: - models_list.append(Model(**post, id=post["model_url"])) + print('models_q='+str(models_q)) + async for model in models_q: + models_list.append(Model(**model, id=model["_id"])) return models_list async def get_model(self, model_url: str) -> Model: