(self, newdata)
return
Try to create a table model from a dict of the form
           {{'rec1': {'col1': 3, 'col2': 2}, ..}
Try to create a table model from a dict of the form
           {{'rec1': {'col1': 3, 'col2': 2}, ..}
Try to create a table model from a dict of the form {{ rec1 : { col1 : 3 col2 : 2 } .. }
def importDict(self, newdata):
        """Try to create a table model from a dict of the form
           {{'rec1': {'col1': 3, 'col2': 2}, ..}"""

        #get cols from sub data keys
        colnames = []
        for k in newdata:
            fields = newdata[k].keys()
            for f in fields:
                if not f in colnames:
                    colnames.append(f)
        for c in colnames:
            self.addColumn(c)
        #add the data
        self.data.update(newdata)
        self.reclist = list(self.data.keys())
        return
def importDict ( self , newdata ) : #get cols from sub data keys colnames = [ ] for k in newdata : fields = newdata [ k ] . keys ( ) for f in fields : if not f in colnames : colnames . append ( f ) for c in colnames : self . addColumn ( c ) #add the data self . data . update ( newdata ) self . reclist = list ( self . data . keys ( ) ) return