def delete_product(id): product = Product.get_or_404(id=id) product.delete()
def get_product(id): product = Product.get_or_404(id=id) return product.hide('category_id')
def _check_relation_exist(t_id, p_id): theme = Theme.get_or_404(id=t_id, e=ThemeNotFound) product = Product.get_or_404(id=p_id, e=ProductNotFound) return theme, product