Пример #1
0
 def save(self):
     controller_id = self.cleaned_data[CONTROLLER_ID]
     doors = self.cleaned_data[DOORS]
     for door in doors:
         ControllerService.attach_door(controller_id=controller_id, door_id=door.id)
Пример #2
0
 def put(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.attach_door(controller_id, door_id)
     return ApiResponse.success()
Пример #3
0
 def save(self):
     controllers = self.cleaned_data['controllers']
     door_id = self.cleaned_data['door_id']
     for controller in controllers:
         ControllerService.attach_door(controller_id=controller.id, door_id=door_id)