예제 #1
0
 def delete_product(id):
     product = Product.get_or_404(id=id)
     product.delete()
예제 #2
0
 def get_product(id):
     product = Product.get_or_404(id=id)
     return product.hide('category_id')
예제 #3
0
 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