Exemplo n.º 1
0
 def test_range_collapse(self):
     flt = filters.RangeFilter()
     flt.bind('foo', mock.Mock())
     value = flt.parse_value(QueryDict("foo.min=a&foo.max=a"))
     params = flt.filter_params(value)
     self.assertEqual(params, {'foo': "a"})
Exemplo n.º 2
0
 class FS(Filterset):
     foo = filters.RangeFilter(child=fields.IntegerField(),
                               source='f_int')
     bar = filters.RangeFilter(child=fields.IntegerField(),
                               lookup=('gt', 'lt'),
                               source='f_int')