def deleteProductFromList(self, list_id, pid): if list_id ==None or pid ==None: return False Product.deleteProduct(pid) ListOfProducts.deleteProduct(pid) return True
def deleteList(self,list_id, group_id): query = List.query(List.ListID == list_id).fetch() if query: for list in query: list.key.delete() GroupLists.deleteList(list_id) productsIds = ListOfProducts.getAllProductsIDs(list_id) if productsIds: for productID in productsIds: Product.deleteProduct(productID) ListOfProducts.deleteList(list_id)