Exemplo n.º 1
0
	def editRecord(self):
		values = dict()
		for i, edit in enumerate(self.edits):
			values[edit.field] = self.getValue(edit)
		if self.values[len(self.values) - 1]['name'] == 'state':
			values['state'] = self.values[len(self.values) - 1]['value']
		appInst.update(self.table, self.keys, values)
		appInst.updateTableViews()
		self.close()
Exemplo n.º 2
0
	def editRecord(self):
		try:
			values = dict()
			for i, edit in enumerate(self.edits):
				values[edit.field] = self.getValue(edit)
			appInst.update(self.table, self.keys, values)
			appInst.updateTableViews()
			self.close()
		except IntegrityError:
			showMessage('Error', 'The same record already exists')