Add default Grid.iter_rows()
implementation.
This commit is contained in:
parent
7c9e7cd138
commit
d960738578
|
@ -139,7 +139,13 @@ class Grid(Object):
|
||||||
return self.fields.itervalues()
|
return self.fields.itervalues()
|
||||||
|
|
||||||
def iter_rows(self):
|
def iter_rows(self):
|
||||||
raise NotImplementedError
|
"""
|
||||||
|
Iterate over the grid rows. The default implementation simply returns
|
||||||
|
an iterator over ``self.rows``; note however that by default there is
|
||||||
|
no such attribute. You must either populate that, or overrirde this
|
||||||
|
method.
|
||||||
|
"""
|
||||||
|
return iter(self.rows)
|
||||||
|
|
||||||
def render(self, template='/grids/grid.mako', **kwargs):
|
def render(self, template='/grids/grid.mako', **kwargs):
|
||||||
kwargs.setdefault('grid', self)
|
kwargs.setdefault('grid', self)
|
||||||
|
|
Loading…
Reference in a new issue