def put(self, note): pos = self.request.stdin.tell() self.request.stdin.seek(0) try: data = json.loads(self.request.stdin.read()) finally: self.request.stdin.seek(pos) note = INote(self.context) note.position_x = data['position_x'] note.position_y = data['position_y'] note.height = data['height'] note.width = data['width'] note.color = data['color'] note.zIndex = data['zIndex'] logging.debug('Object updated %s' % str(data)) return True
def put(self, note): self._check_permission(permissions.ModifyPortalContent) pos = self.request.stdin.tell() self.request.stdin.seek(0) try: data = json.loads(self.request.stdin.read()) finally: self.request.stdin.seek(pos) note = INote(self.context) note.position_x = data['position_x'] note.position_y = data['position_y'] note.height = data['height'] note.width = data['width'] note.color = data['color'] note.zIndex = data['zIndex'] logging.debug('Object updated %s' % str(data)) return True
def test_position_x_getting_setting(self): from collective.noticeboard.interfaces import INote note = INote(self.news) note.position_x = "333" self.assertEquals("333", note.position_x)
def test_position_x_getting_setting(self): from collective.noticeboard.interfaces import INote note = INote(self.news) note.position_x = '333' self.assertEquals('333', note.position_x)