def ok(self): item = ScrumblesObjects.Item oldItem = self.item item.itemID = oldItem.itemID item.itemTitle = self.itemTitleEntry.get() if item.itemTitle != oldItem.itemTitle: self.validateName(item.itemTitle) item.itemDescription = self.itemDescriptionEntry.get('1.0', 'end-1c') item.itemType = self.ItemTypebox.get() item.itemUserID = self.getSelectedUserID() sprintID, sprintDueDate = self.getSelectedSprintParams() item.itemSprintID = sprintID item.itemDueDate = sprintDueDate item.itemPriority = item.priorityTextToNumberMap[ self.itemPriorityCombobox.get()] item.itemCodeLink = self.itemCodeLinkEntry.get() item.itemStatus = self.discoverStatus(item) item.itemPoints = oldItem.itemPoints comment = ScrumblesObjects.Comment() comment.commentContent = self.commentTextBox.get('1.0', 'end-1c') comment.commentUserID = self.master.activeUser.userID comment.commentItemID = item.itemID if len(comment.commentContent) <= 0: raise Exception( 'Comment box cannot be blank\nPlease enter a change reason.') try: self.dataBlock.updateScrumblesObject(item, oldItem, comment) except IntegrityError: comment.commentID = ScrumblesObjects.generateRowID() self.dataBlock.updateScrumblesObject(item, oldItem, comment) messagebox.showinfo('Info', "Item '%s' Successfully Updated" % item.itemTitle) self.exit()
def writeData(self,obj): try: self.dataBlock.addNewScrumblesObject(obj) except IntegrityError: logging.exception('ID Collision') obj.sprintID = ScrumblesObjects.generateRowID() self.dataBlock.addNewScrumblesObject(obj) else: messagebox.showinfo('Info', 'New Sprint Successfully Created')
def writeData(self, item, comment): if not item.itemPoints.isdigit(): raise Exception('Points must be a number') try: self.dataBlock.addNewScrumblesObject(item) except IntegrityError: logging.exception('ID Collision') item.itemID = ScrumblesObjects.generateRowID() comment.commentItemID = item.itemID self.dataBlock.addNewScrumblesObject(item) if len(comment.commentContent) > 0: try: self.dataBlock.addNewScrumblesObject(comment) except IntegrityError: comment.commentID = ScrumblesObjects.generateRowID() self.dataBlock.addNewScrumblesObject(comment) else: messagebox.showinfo('Info', 'New Item Successfully Created') self.dataBlock.addItemToProject(self.parent.activeProject, item)
def ok(self): project = ScrumblesObjects.Project() project.projectName = self.projectTitleEntry.get() self.validateName(project.projectName) try: if not self.isTest: self.dataBlock.addNewScrumblesObject(project) else: print('TESTMODE: self.dataBlock.addNewScrumblesObject(%s)' % repr(project)) except IntegrityError: logging.exception('ID Collision') project.projectID = ScrumblesObjects.generateRowID() self.dataBlock.addNewScrumblesObject(project) else: messagebox.showinfo('Info', 'New Item Successfully Created') self.exit()
def ok(self): self.validatePasswordMatch(self.passwordEntry.get(), self.reEnterPasswordEntry.get()) user = ScrumblesObjects.User() user.userName = self.userNameEntry.get() user.userPassword = self.passwordEntry.get() user.userEmailAddress = self.emailEntry.get() user.userRole = self.roleCombobox.get() self.validateName(user.userName) try: if not self.isTest: self.dataBlock.addNewScrumblesObject(user) except IntegrityError: logging.exception('ID Collision') user.userID = ScrumblesObjects.generateRowID() self.dataBlock.addNewScrumblesObject(user) else: messagebox.showinfo('Info', 'New User Successfully Created') self.exit()