- Can show relations

git-svn-id: http://galileo.dmi.unict.it/svn/relational/trunk@324 014f5005-505e-4b48-8d0a-63407b615a7c
This commit is contained in:
LtWorf 2011-10-13 18:10:01 +00:00
parent e6c871b785
commit 144ee8fabc

View File

@ -40,8 +40,24 @@ class creatorForm(QtGui.QDialog):
if self.rel==None: if self.rel==None:
self.setup_empty() self.setup_empty()
else: else:
self.setup_replation(rel) self.setup_relation(self.rel)
def setup_relation(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 pass
def setup_empty(self): def setup_empty(self):
self.table.insertColumn(0) self.table.insertColumn(0)
@ -104,4 +120,5 @@ def editRelation(rel=None):
if __name__ == '__main__': if __name__ == '__main__':
import sys import sys
app = QtGui.QApplication(sys.argv) app = QtGui.QApplication(sys.argv)
print editRelation() r=relation.relation("/home/salvo/dev/relational/trunk/samples/people.csv")
print editRelation(r)