Beispiel #1
0
 def save(self):
     if self.cleaned_data[PLACE_ID]:
         place_id = self.cleaned_data[PLACE_ID]
         doors = self.cleaned_data[DOORS]
         for door in doors:
             PlaceService.detach_door(place_id=place_id, door_id=door.id)
     if self.cleaned_data[CONTROLLER_ID]:
         controller_id = self.cleaned_data[CONTROLLER_ID]
         doors = self.cleaned_data[DOORS]
         for door in doors:
             ControllerService.detach_door(controller_id=controller_id, door_id=door.id)
Beispiel #2
0
 def delete(self, request: HttpRequest, controller_id: str, door_id: str):
     controller_id = self.parse_int_pk(controller_id)
     door_id = self.parse_int_pk(door_id)
     ControllerService.detach_door(controller_id, door_id)
     return ApiResponse.success()
 def save(self):
     controllers = self.cleaned_data['controllers']
     door_id = self.cleaned_data['door_id']
     for controller in controllers:
         ControllerService.detach_door(controller_id=controller.id, door_id=door_id)