From fe68217fbacaa6b15c5d88b9fabcaf9f981974a6 Mon Sep 17 00:00:00 2001 From: Paul Makepeace Date: Tue, 26 Apr 2011 19:09:52 -0400 Subject: [PATCH] Take expression out of Facet and put it in TextFacet. Add case_sensitive to TextFilterFacet --- google/refine/facet.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/google/refine/facet.py b/google/refine/facet.py index 88d52ac..ef10397 100644 --- a/google/refine/facet.py +++ b/google/refine/facet.py @@ -22,11 +22,10 @@ def from_camel(attr): class Facet(object): - def __init__(self, column, type, expression='value', **options): + def __init__(self, column, type, **options): self.type = type self.name = column self.column_name = column - self.expression = expression for k, v in options.items(): setattr(self, k, v) @@ -37,12 +36,15 @@ class Facet(object): class TextFilterFacet(Facet): def __init__(self, column, query, **options): - super(TextFilterFacet, self).__init__(column, query=query, type='text', - mode='text', **options) + super(TextFilterFacet, self).__init__( + column, query=query, case_sensitive=False, type='text', + mode='text', **options) class TextFacet(Facet): - def __init__(self, column, selection=None, omit_blank=False, omit_error=False, select_blank=False, select_error=False, invert=False, **options): + def __init__(self, column, selection=None, expression='value', + omit_blank=False, omit_error=False, select_blank=False, + select_error=False, invert=False, **options): super(TextFacet, self).__init__( column, type='list', @@ -52,6 +54,7 @@ class TextFacet(Facet): select_error=select_error, invert=invert, **options) + self.expression = expression self.selection = [] if selection is None: selection = []