def __createTask(self, newTask, session): task = Task.insertFormDict(session, newTask) session.flush() self._replay(task.id) if task.creatorId != task.receiverId: self.getClient(task.receiverId).newTask(task) return task
def __updateTask(self, newTask, session): task = Task.updateFormDict(session, newTask, force=True) session.add(task) session.flush() self._replay(task.id) if task.creatorId != task.receiverId: otherClientId = task.creatorId if self.sender.ID == task.receiverId else task.receiverId self.getClient(otherClientId).taskUpdated(task) return task