示例#1
0
 def post(self):
     content = request.get_json()
     admin = PanelAdmin()
     admin.id = content.get('id')
     admin.prices = content.get('price')
     respuesta = admin.set_price()
     return jsonify(), 200
示例#2
0
 def get(self, id):
     admin = PanelAdmin()
     admin.id = int(id)
     respuesta = admin.bring_data_edit()
     if (respuesta):
         return jsonify(respuesta), 200
     else:
         jsonify(), 400
示例#3
0
 def get(self, id):
     admin = PanelAdmin()
     admin.id = int(id)
     respuesta = admin.get_prices()
     if respuesta:
         return jsonify(respuesta), 200
     else:
         return jsonify(), 400
示例#4
0
 def post(self):
     content = request.get_json()
     admin = PanelAdmin()
     admin.name = content.get("name")
     admin.type = int(content.get("type"))
     admin.img = content.get("img")
     admin.imgc1 = content.get("imgc1")
     admin.imgc2 = content.get("imgc2")
     admin.imgc3 = content.get("imgc3")
     admin.category = int(content.get("category"))
     admin.locate = int(content.get("locate"))
     admin.description = content.get("description")
     admin.id = int(content.get('id'))
     respuesta = admin.update()
     return jsonify(), 200
示例#5
0
 def post(self):
     content = request.get_json()
     admin = PanelAdmin()
     admin.id = int(content)
     respuesta = admin.delete_price()
     return jsonify(), 200