From 52342a7612b1489a4a4834188a09635512106106 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sun, 22 Oct 2017 20:56:30 -0700 Subject: [PATCH] Fix value auto-selection for enum grid filters --- tailbone/grids/filters.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tailbone/grids/filters.py b/tailbone/grids/filters.py index e5618320..87523d32 100644 --- a/tailbone/grids/filters.py +++ b/tailbone/grids/filters.py @@ -29,6 +29,7 @@ from __future__ import unicode_literals, absolute_import import datetime import logging +import six import sqlalchemy as sa from rattail.gpc import GPC @@ -106,7 +107,7 @@ class EnumValueRenderer(ChoiceValueRenderer): def __init__(self, enum): sorted_keys = sorted(enum, key=lambda k: enum[k].lower()) - self.options = [tags.Option(enum[k], k) for k in sorted_keys] + self.options = [tags.Option(enum[k], six.text_type(k)) for k in sorted_keys] class GridFilter(object):