Use new API to edit relations

master
Salvo 'LtWorf' Tomaselli 2020-08-15 21:06:57 +07:00
parent 1bbef1f1b8
commit 200c748ee5
No known key found for this signature in database
GPG Key ID: B3A7CF0C801886CF
1 changed files with 4 additions and 6 deletions

@ -84,14 +84,13 @@ class creatorForm(QtWidgets.QDialog):
for i in range(self.table.columnCount()))
try:
header = relation.header(h)
header = relation.Header(h)
except Exception as e:
QtWidgets.QMessageBox.information(None, QtWidgets.QApplication.translate("Form", "Error"), "%s\n%s" % (
QtWidgets.QApplication.translate("Form", "Header error!"), e.__str__()))
return None
r = relation.relation()
r.header = header
content = []
for i in range(1, self.table.rowCount()):
hlist = []
for j in range(self.table.columnCount()):
@ -101,11 +100,10 @@ class creatorForm(QtWidgets.QDialog):
QtWidgets.QMessageBox.information(None, QtWidgets.QApplication.translate(
"Form", "Error"), QtWidgets.QApplication.translate("Form", "Unset value in %d,%d!" % (i + 1, j + 1)))
return None
r.insert(hlist)
return r
content.append(hlist)
return relation.Relation.create_from(header, content)
def accept(self):
self.result_relation = self.create_relation()
# Doesn't close the window in case of errors