PEATDB/Tables.py
def fill_down(self, rowlist, collist):
        """Fill down a column, or multiple columns"""
        model = self.model
        absrow  = self.get_AbsoluteRow(rowlist[0])
        #remove first element as we don't want to overwrite it
        rowlist.remove(rowlist[0])

        #if this is a formula, we have to treat it specially
        for col in collist:
            val = self.model.getCellRecord(absrow, col)
            f=val #formula to copy
            i=1
            for r in rowlist:
                absr = self.get_AbsoluteRow(r)
                if Formula.isFormula(f):
                    newval = model.copyFormula(f, absr, col, offset=i)
                    model.setFormulaAt(newval, absr, col)
                else:
                    model.setValueAt(val, absr, col)
                #print 'setting', val, 'at row', r
                i+=1

        self.redrawTable()
        return
Fill down a column, or multiple columns
Fill down a column, or multiple columns
Fill down a column or multiple columns
def fill_down(self, rowlist, collist):
        model = self.model
        absrow  = self.get_AbsoluteRow(rowlist[0])
        rowlist.remove(rowlist[0])
        for col in collist:
            val = self.model.getCellRecord(absrow, col)
            f=val 
            i=1
            for r in rowlist:
                absr = self.get_AbsoluteRow(r)
                if Formula.isFormula(f):
                    newval = model.copyFormula(f, absr, col, offset=i)
                    model.setFormulaAt(newval, absr, col)
                else:
                    model.setValueAt(val, absr, col)
                i+=1
        self.redrawTable()
        return
def fill_down ( self , rowlist , collist ) : model = self . model absrow = self . get_AbsoluteRow ( rowlist [ 0 ] ) rowlist . remove ( rowlist [ 0 ] ) for col in collist : val = self . model . getCellRecord ( absrow , col ) f = val i = 1 for r in rowlist : absr = self . get_AbsoluteRow ( r ) if Formula . isFormula ( f ) : newval = model . copyFormula ( f , absr , col , offset = i ) model . setFormulaAt ( newval , absr , col ) else : model . setValueAt ( val , absr , col ) i += 1 self . redrawTable ( ) return
Fill down a column, or multiple columns
Fill down a column or multiple columns
"""Fill down a column, or multiple columns""" #remove first element as we don't want to overwrite it #if this is a formula, we have to treat it specially #formula to copy #print 'setting', val, 'at row', r
self
rowlist
collist