From d960738578232bf4f2ddfb93ee9f51e8c718fa16 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Tue, 10 Mar 2015 12:44:58 -0500 Subject: [PATCH] Add default `Grid.iter_rows()` implementation. --- tailbone/grids/core.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tailbone/grids/core.py b/tailbone/grids/core.py index 3d9b5ef3..911441ae 100644 --- a/tailbone/grids/core.py +++ b/tailbone/grids/core.py @@ -139,7 +139,13 @@ class Grid(Object): return self.fields.itervalues() 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): kwargs.setdefault('grid', self)