Exemple #1
0
    def post(self):
        if User_tool.check_before_start("editCar", self) >= 0:

            dati = json.loads(self.request.body)

            car_data = dati["Car"]
            bluetooth_MAC = ""
            bluetooth_name = ""
            register = ""
            maker_color = None
            if "Bluetooth_MAC" in car_data:
                bluetooth_MAC = car_data["Bluetooth_MAC"]
            if "Bluetooth_Name" in car_data:
                bluetooth_name = car_data["Bluetooth_Name"]
            if "Register" in car_data:
                register = car_data["Register"]
            if "Marker_Color" in car_data:
                maker_color = car_data["Marker_Color"]

            Car.update_car(car_data["ID_car"], bluetooth_MAC, bluetooth_name,
                           car_data["Brand"], car_data["Name"], register,
                           maker_color)

            right = StatusReturn(19, "editCar")
            self.response.write(right.print_result())
Exemple #2
0
 def post(self):
     if User_tool.check_before_start("editCar", self) >= 0:
         data = json.loads(self.request.body)
         id = data["ID_car"]
         email = data["Email"]
         bluetooth_MAC = data["Bluetooth_MAC"]
         bluetooth_name = data["Bluetooth_name"]
         brand = data["Brand"]
         name = data["Name"]
         try:
             Car.update_car(id, bluetooth_MAC, bluetooth_name, brand, email, name)
             right = StatusReturn(16, "editCar")
             self.response.write(right.print_result())
         except:
             self.error(500)
             error = StatusReturn(8, "editCar", str(sys.exc_info()))
             self.response.write(error.print_general_error())
Exemple #3
0
    def post(self):
        if User_tool.check_before_start("editCar", self) >= 0:

            dati = json.loads(self.request.body)

            car_data = dati["Car"]
            bluetooth_MAC = ""
            bluetooth_name = ""
            register = ""
            maker_color = None
            if "Bluetooth_MAC" in car_data:
                bluetooth_MAC = car_data["Bluetooth_MAC"]
            if "Bluetooth_Name" in car_data:
                bluetooth_name = car_data["Bluetooth_Name"]
            if "Register" in car_data:
                register = car_data["Register"]
            if "Marker_Color" in car_data:
                maker_color = car_data["Marker_Color"]

            Car.update_car(car_data["ID_car"], bluetooth_MAC, bluetooth_name, car_data["Brand"], car_data["Name"],
                           register, maker_color)

            right = StatusReturn(19, "editCar")
            self.response.write(right.print_result())