def get(self, category_id=None, user_id=None): """Retrieve all object categories or a specific one :param category_id: uuid of the object category :param user_id: user ID who do the request :return: { "object_category_id": { "name": "name of the category", "description": "description of the category (optional)" } } :internal_api: get_object_categories """ data = ModelManager.get_object_categories(user_id=user_id, category_id=category_id) return {"object_categories": data}
def get(self, category_id=None, user_id=None): """Retrieve all object categories or a specific one :param category_id: uuid of the object category :param user_id: user ID who do the request :return: { "object_category_id": { "name": "name of the category", "description": "description of the category" } } :internal_api: get_object_categories """ try: data = ModelManager.get_object_categories(user_id=user_id, category_id=category_id) except Exception as e: logger.error(e, exc_info=True) return {"result": False, "error": str(e)}, 500 return {"object_categories": data}
def get_object_category(cat_id=None): from python_moondb.core import ModelManager category = ModelManager.get_object_categories(user_id=None, category_id=cat_id) return category