def add_resource(self, resourceData: Dict): new_resource = Resource(self.__database_manager.get_next_resource_id(), resourceData["title"], resourceData["link"], author=resourceData["author"], subject=resourceData["subject"], resource_type=Resource.Type( resourceData["type"]), isbn=resourceData["isbn"]) self.__resource_list.append(new_resource) self.__database_manager.add_resource(new_resource)
def create_resource(resource_data: Tuple[str, str, str, str, str, str, str]) -> Resource: return Resource(int(resource_data[0]), resource_data[1], resource_data[2], author=resource_data[3], subject=resource_data[4], resource_type=Resource.Type(resource_data[5]), isbn=resource_data[6])