Skip to content

Commit ca211ca

Browse files
author
Steve Canny
committed
tbl: base _ColumnCells on Parented
1 parent ce779e5 commit ca211ca

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

docx/table.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def cells(self):
124124
Sequence of |_Cell| instances corresponding to cells in this column.
125125
Supports ``len()``, iteration and indexed access.
126126
"""
127-
return _ColumnCells(self._tbl, self._gridCol)
127+
return _ColumnCells(self._tbl, self._gridCol, self)
128128

129129
@property
130130
def width(self):
@@ -139,13 +139,13 @@ def width(self, value):
139139
self._gridCol.w = value
140140

141141

142-
class _ColumnCells(object):
142+
class _ColumnCells(Parented):
143143
"""
144144
Sequence of |_Cell| instances corresponding to the cells in a table
145145
column.
146146
"""
147-
def __init__(self, tbl, gridCol):
148-
super(_ColumnCells, self).__init__()
147+
def __init__(self, tbl, gridCol, parent):
148+
super(_ColumnCells, self).__init__(parent)
149149
self._tbl = tbl
150150
self._gridCol = gridCol
151151

tests/test_table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def cells_fixture(self):
232232
cell_count = 2
233233
tbl = _tbl_bldr(rows=cell_count, cols=1).element
234234
gridCol = tbl.tblGrid.gridCol_lst[0]
235-
cells = _ColumnCells(tbl, gridCol)
235+
cells = _ColumnCells(tbl, gridCol, None)
236236
return cells, cell_count
237237

238238

0 commit comments

Comments
 (0)