add items method to treat TableCellStyle as dict

This commit is contained in:
hplattner 2012-04-12 11:20:30 +02:00
parent ec5e832dd6
commit 41b1aa2630

View file

@ -47,17 +47,19 @@ class Style(object):
def __str__(self): def __str__(self):
return ';'.join('%s: %s' % (k, v) for k, v in self.data.items()) return ';'.join('%s: %s' % (k, v) for k, v in self.data.items())
def items(self):
return self.data.items()
class TableCellStyle(Style): class TableCellStyle(Style):
initData = dict( initData = {
width='auto', 'width':'auto',
textalign='left', 'text-align':'left',
bordertop='1px solid #000', 'border-top':'1px solid #000',
borderright='1px solid #000', 'border-right':'1px solid #000',
borderbottom='1px solid #000', 'border-bottom':'1px solid #000',
borderleft='1px solid #000', 'border-left':'1px solid #000',
) }
class Field(Component): class Field(Component):
@ -77,12 +79,6 @@ class Field(Component):
colspan=1 colspan=1
colheaderspan=1 colheaderspan=1
style = TableCellStyle() style = TableCellStyle()
colwidth='auto'
coltextalign='left'
colbordertop='1px solid #000'
colborderright='1px solid #000'
colborderbottom='1px solid #000'
colborderleft='1px solid #000'
executionSteps = ['query', 'sort', 'output'] # , 'totals'] executionSteps = ['query', 'sort', 'output'] # , 'totals']