From 144ee8fabc941f522761c7bd7cf0590c2bcec54a Mon Sep 17 00:00:00 2001 From: LtWorf Date: Thu, 13 Oct 2011 18:10:01 +0000 Subject: [PATCH] - Can show relations git-svn-id: http://galileo.dmi.unict.it/svn/relational/trunk@324 014f5005-505e-4b48-8d0a-63407b615a7c --- relational_gui/creator.py | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/relational_gui/creator.py b/relational_gui/creator.py index 8ad8d4c..1b1e65d 100644 --- a/relational_gui/creator.py +++ b/relational_gui/creator.py @@ -40,8 +40,24 @@ class creatorForm(QtGui.QDialog): if self.rel==None: self.setup_empty() else: - self.setup_replation(rel) - def setup_relation(rel): + self.setup_relation(self.rel) + def setup_relation(self,rel): + + self.table.insertRow(0) + + for i in rel.header.attributes: + item=QtGui.QTableWidgetItem() + item.setText(i) + self.table.insertColumn(self.table.columnCount()) + self.table.setItem(0,self.table.columnCount()-1,item) + + for i in rel.content: + self.table.insertRow(self.table.rowCount()) + for j in range(len(i)): + item=QtGui.QTableWidgetItem() + item.setText(i[j]) + self.table.setItem(self.table.rowCount()-1,j,item) + pass def setup_empty(self): self.table.insertColumn(0) @@ -104,4 +120,5 @@ def editRelation(rel=None): if __name__ == '__main__': import sys app = QtGui.QApplication(sys.argv) - print editRelation() + r=relation.relation("/home/salvo/dev/relational/trunk/samples/people.csv") + print editRelation(r)