def deleteProduct(productName): for product in products: if (product["name"] == productName): products.remove(product) return jsonify({"message": "Product was delete successfully"}) return jsonify({"message": 'This product is not registered'})
def deleteProduct(product_name): productFound = [product for product in products if product['name'] == product_name] if (len(productFound) > 0): products.remove(productFound[0]) return jsonify({"message": "Product deleted", "products": products}) else: return jsonify({"message": "Product not found"})
def deleteProduct(product_name): productsFound = [ product for product in products if product['name'] == product_name ] if len(productsFound) > 0: products.remove(productsFound[0]) return jsonify({'message': 'Product Deleted', 'products': products})
def deliteProduct(product_name): productsFound = [ product for product in products if product['nombre'] == product_name ] if (len(productsFound) > 0): products.remove(productsFound[0]) return jsonify({"mensage": "producto eliminado", "products": products}) return jsonify({"mensage": "producto no encontrado"})
def deleteProduct(product_name): productFound = [ product for product in products if product["name"] == product_name ] if productFound: products.remove(productFound[0]) return jsonify({"message": "producto Deleted", "products": products}) return jsonify({"message": "Product not found"})
def deleteProduct(product_name): productsFound = [ product for product in products if product['name'] == product_name ] if len(productsFound) > 0: products.remove(productsFound[0]) return jsonify({"message": "Product Deleted", "products": products}) return jsonify({"message": "Product Not found"})
def deleteProduct(product_name): for product in products: if product['name'] == product_name.lower(): productsFound = product #productsFound = [product for product in products if product['name'] == product_name] if len(productsFound) > 0: products.remove(productsFound[0]) return jsonify({'message': 'Producto Borrado', 'products': products})
def delete_product(product_name): product_found = [ product for product in products if product["name"] == product_name ] if (len(product_found) > 0): products.remove(product_found[0]) return jsonify({"Message": "Product deleted", "Products": products}) return jsonify({"Message": "Product not found"})
def deleteProduct(product_name): productsFound = [ product for product in products if product['name'] == product_name.capitalize()] if len(productsFound) > 0: products.remove(productsFound[0]) return jsonify({"message": "deleted", "products": products}) else: return jsonify({"message": "product not found"})
def deleteProduct(product_name): productFound = [ product for product in products if product['name'] == product_name ] if (len(productFound) > 0): products.remove(productFound[0]) return jsonify({'message': 'Product deleted', 'products': products}) return jsonify({"message": "product unavailable"})
def deleteProduct(product_name): productsFound = [product for product in products if product['name'] == product_name] if len(productsFound) > 0: products.remove(productsFound[0]) return jsonify({ "message": "Producto borrado", "products": products }) return jsonify({"message: Producto no encontrado"})
def deleteProduct(produc_name): producto = [ product for product in products if product['name'] == produc_name ] if (len(producto) > 0): products.remove(producto[0]) return jsonify({"mensaje": "eliminado", "productos": products}) else: return jsonify({"mensaje": "prodcuto no encontrado"})
def deleteProduct(product_name): productFounts = [ product for product in products if product['name'] == product_name ] if (len(productFounts) > 0): products.remove(productFounts[0]) return jsonify({"message": "Producto eliminado satifactoriamente"}) else: return jsonify({"message": "Producto no encontrado"})
def delete_product(product_name): products_found = [ product for product in products if product["name"] == product_name ] if len(products_found) > 0: products.remove(products_found[0]) return jsonify({"message": "product deleted", "products": products}) else: return jsonify({"error": "product not found"})
def deleteProduct(product_name): ProductFoundDelete = [product for product in products if product['name'] == product_name] if (len(ProductFoundDelete) >0 ): products.remove(ProductFoundDelete[0]) return jsonify({ "message" : "Product Delete", "products": products }) return jsonify({"message" : "Product Not Found, not delete"})
def deleteProduct(product_name): ProductFound = [product for product in products if product['name'] == product_name] if len(ProductFound) > 0: #from list products, using "remove property" inside parenthesis fist product found in the list ProductFound products.remove(ProductFound[0]) return jsonify({ "Message": "Product " + product_name + " Was Deleted Successfully", "Product List": products }) return jsonify({"Message " : "Product Not Found"})
def deleteProduct(product_name): productFound = [ product for product in products if product['name'] == product_name ] if len(productFound): products.remove(productFound[0]) return jsonify({ "message": "Product removed from products", "products": products }) return jsonify("Product not Found")
def deleteProduct(product_brand): # obtenemos solo el producto solicitado product_found = [ product for product in products if product['brand'] == product_brand ] # Si el tamaño de la lista es mayor a 0 entonces existen productos if (len(product_found) > 0): # Eliminamos el producto encontrado products.remove(product_found[0]) # Retornamos el producto o productos encontrados return redirect('http://127.0.0.1/exampleRest/') return jsonify([{"product": "Producto no encontrado"}])
def deleteProduct(product_name): product_found = [ product for product in products if product['name'] == product_name ] if (len(product_found)) > 0: products.remove(product_found[0]) return jsonify({ "message": "Produc Deleted", "products": products, "status": 200 }) return jsonify({"message": "product not found", "status": 400})
def deleteProduct(product_name): #Igual que antes se verifica si existe productFound = [product for product in products if product['name'] == product_name] if (len(productFound) > 0): #Se elimina products.remove(productFound[0]) #Se imprime return jsonify({ "message": "Product deleted", "product": products }) #No existe algo que editar return jsonify({"message": "Product not found"})
def deleteProduct(product_name): for product in products: if product.get("name") == product_name: products.remove(product) return jsonify({ "message": "Product Deleted", "delete_product": products, }) else: return jsonify({ "error": "Product not Found", "message": "❌ Product not found" })
def deleteProduct(id_product): productsFound = [ product for product in products if product['id'] == id_product ] if (len(productsFound) > 0): print(products) print(productsFound) products.remove(productsFound[0]) return jsonify({ "Message": "Product deleted successfully", "Products": products }) return jsonify({"Message": "Product not found"})
def productDelete(product_name): productFound = [ products for products in products if products['name'] == product_name] if ( len(productFound) > 0 ): products.remove(productFound[0]) return jsonify({ "message":"product delete list" }) return jsonify({ "message": "product no found in delete" })
def deleteProduct( productName ): if len( products ) > 0: for product in products: if product['name'] == productName: products.remove( product ) return jsonify({ 'message': 'producto actualizado', 'products': products }) # sino encuentra producto return jsonify({ 'message': 'producto no encontrado' }) # sino encuentra productos registrados return jsonify({ 'message': 'no hay productos registrados' })
def deleteproduct(product_name): productFound = [product for product in products if product['name'] == product_name] if (len(productFound) > 0): products.remove(productFound[0]) return jsonify({"New list of Products":products}) return jsonify({"message":"Product not Found"})
def productDelete(id): foundList = [product for product in products if product['id'] == id] if (len(foundList) > 0): products.remove(foundList[0]) return jsonify({"message": "product deleted", "products": products}) return jsonify({ "message": "product not found"})
def deleteProduct(argv): productFound = [product for product in products if product['name'] == argv] if (len(productFound) > 0): products.remove(productFound[0]) return jsonify({'message': 'Product deleted', 'products': products}) return jsonify({'message': 'Product not found'})
def deleteProduct(product_name): productsFound = [product for product in products if product['name'] == product_name] if len(productsFound) > 0: products.remove(productsFound[0]) jsonify({'response' : 'OK'}) return jsonify({'message': 'ERROR'})