Skip to content

Commit

Permalink
Fix/improve terms.
Browse files Browse the repository at this point in the history
  • Loading branch information
thefunny42 committed Sep 1, 2016
1 parent c079c77 commit 3292850
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/hurry/query/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,18 +429,16 @@ def key(self, context=None):

class Between(FieldTerm):

def __init__(self, index_id, min_value, max_value):
def __init__(self, index_id,
minimum=None, maximum=None):
super(Between, self).__init__(index_id)
self.min_value = min_value
self.max_value = max_value
self.options = (minimum, maximum)

def apply(self, cache, context=None):
return self.getIndex(context).apply((self.min_value, self.max_value))
return self.getIndex(context).apply(self.options)

def key(self, context=None):
return ('between',
self.catalog_name, self.index_name,
self.min_value, self.max_value)
return ('between', self.catalog_name, self.index_name, self.options)


class Ge(Between):
Expand All @@ -460,7 +458,7 @@ class In(FieldTerm):
def __init__(self, index_id, values):
assert None not in values
super(In, self).__init__(index_id)
self.values = values
self.values = tuple(values)

def apply(self, cache, context=None):
results = []
Expand Down

0 comments on commit 3292850

Please sign in to comment.