예제 #1
0
 def save(self, commit=True):
     door = DoorService.update(
         id=self.cleaned_data[ID],
         name=self.cleaned_data[NAME],
         access_id=self.cleaned_data[ACCESS_ID]
     )
     return door
예제 #2
0
 def put(self, request: HttpRequest, id: str, dto: DoorInDto):
     id = self.parse_int_pk(id)
     door = DoorService.update(id, dto.name, dto.access_id)
     return ApiResponse.success(DoorOutDto.from_door(door))