Commits

Luke Plant committed 6351a65

Corrected NumericRangeFilter to handle the lower limit of a range more nicely

  • Participants
  • Parent commits f465f36

Comments (0)

Files changed (2)

File django_easyfilters/filters.py

             if len(self.values) == 1:
                 return {field_name: self.values[0]}
             else:
-                return {field_name + '__gte': self.values[0],
+                return {field_name + '__gt': self.values[0],
                         field_name + '__lte': self.values[1]}
 
         def __unicode__(self):
 
     return NumericRangeChoice
 
+
 class NumericRangeFilter(RangeFilterMixin, Filter):
 
     def __init__(self, field, model, params, **kwargs):

File django_easyfilters/tests/filterset.py

 
         qs_filtered = filter1.apply_filter(qs)
         self.assertEqual(list(qs_filtered),
-                         list(qs.filter(price__gte=Decimal('3.50'),
+                         list(qs.filter(price__gt=Decimal('3.50'),
                                         price__lte=Decimal('4.00'))))