From 91b395118e005906578c42dd1dc5b7d8148c5ba7 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 9 Feb 2018 21:13:41 -0600 Subject: [PATCH] Allow passing arbitrary attrs when rendering grid --- tailbone/grids/core.py | 1 + tailbone/templates/grids/grid.mako | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tailbone/grids/core.py b/tailbone/grids/core.py index 182c1a5c..83a10823 100644 --- a/tailbone/grids/core.py +++ b/tailbone/grids/core.py @@ -375,6 +375,7 @@ class Grid(object): elif self.width == 'half': grid_class = 'half' context['grid_class'] = '{} {}'.format(grid_class, context.get('grid_class', '')) + context.setdefault('grid_attrs', {}) return render(template, context) def get_default_filters(self): diff --git a/tailbone/templates/grids/grid.mako b/tailbone/templates/grids/grid.mako index 283ba289..0b4c1d39 100644 --- a/tailbone/templates/grids/grid.mako +++ b/tailbone/templates/grids/grid.mako @@ -1,5 +1,5 @@ ## -*- coding: utf-8; -*- -
+
${grid.make_webhelpers_grid()}