@@ -25,7 +25,7 @@ def add_column(self):
2525 gridCol = tblGrid .add_gridCol ()
2626 for tr in self ._tbl .tr_lst :
2727 tr .add_tc ()
28- return _Column (gridCol )
28+ return _Column (gridCol , self . _tbl )
2929
3030 def add_row (self ):
3131 """
@@ -67,16 +67,29 @@ class _Column(object):
6767 """
6868 Table column
6969 """
70- def __init__ (self , gridCol ):
70+ def __init__ (self , gridCol , tbl ):
7171 super (_Column , self ).__init__ ()
7272 self ._gridCol = gridCol
73+ self ._tbl = tbl
74+
75+ @lazyproperty
76+ def cells (self ):
77+ """
78+ |_ColumnCellCollection| instance containing sequence of |_Cell|
79+ instances corresponding to cells in this column.
80+ """
81+ return _ColumnCellCollection (self ._tbl , self ._gridCol )
7382
7483
7584class _ColumnCellCollection (object ):
7685 """
7786 Sequence of |_Cell| instances corresponding to the cells in a table
7887 column.
7988 """
89+ def __init__ (self , tbl , gridCol ):
90+ super (_ColumnCellCollection , self ).__init__ ()
91+ self ._tbl = tbl
92+ self ._gridCol = gridCol
8093
8194
8295class _ColumnCollection (object ):
@@ -96,10 +109,10 @@ def __getitem__(self, idx):
96109 except IndexError :
97110 msg = "column index [%d] is out of range" % idx
98111 raise IndexError (msg )
99- return _Column (gridCol )
112+ return _Column (gridCol , self . _tbl )
100113
101114 def __iter__ (self ):
102- return (_Column (gridCol ) for gridCol in self ._gridCol_lst )
115+ return (_Column (gridCol , self . _tbl ) for gridCol in self ._gridCol_lst )
103116
104117 def __len__ (self ):
105118 return len (self ._gridCol_lst )
@@ -122,7 +135,7 @@ def __init__(self, tr):
122135 super (_Row , self ).__init__ ()
123136 self ._tr = tr
124137
125- @property
138+ @lazyproperty
126139 def cells (self ):
127140 """
128141 Sequence of |_Cell| instances corresponding to the cells in this row.
0 commit comments