From f680d48346e3e02b9dc36b703559fe686d69440a Mon Sep 17 00:00:00 2001 From: Guilherme Gondim Date: Mon, 15 Sep 2008 18:23:05 +0000 Subject: [PATCH] =?UTF-8?q?Adicionado=20cr=C3=A9dito=20e=20licen=C3=A7a=20?= =?UTF-8?q?para=20RangeValuesFilterSpec,=20autorizado=20por=20Willie=20Gol?= =?UTF-8?q?lino.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/admin/filterspecs.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sigi/admin/filterspecs.py b/sigi/admin/filterspecs.py index 1d4959b..204a5a9 100644 --- a/sigi/admin/filterspecs.py +++ b/sigi/admin/filterspecs.py @@ -41,6 +41,9 @@ FilterSpec.filter_specs.insert(0, (lambda f: getattr(f, 'alphabetic_filter', Fal class RangeValuesFilterSpec(FilterSpec): """ + Author: Willie Gollino (wgollino@yahoo.com) + License: LGPLv3 + Adds filtering by ranges of values in the admin filter sidebar. Set range split points in the model field attribute 'list_filter_range'. @@ -53,8 +56,9 @@ class RangeValuesFilterSpec(FilterSpec): my_model_field >= 300 """ - def __init__(self, f, request, params, model): - super(RangeValuesFilterSpec, self).__init__(f, request, params, model) + def __init__(self, f, request, params, model, model_admin): + super(RangeValuesFilterSpec, self).__init__(f, request, params, model, + model_admin) self.field_generic = '%s__' % self.field.name self.parsed_params = dict([(k, v) for k, v in params.items() if k.startswith(self.field_generic)])