Skip to content

Commit

Permalink
Merge pull request #1848 from cdonati/handle-order-operation
Browse files Browse the repository at this point in the history
Handle order operation
  • Loading branch information
menivaitsi committed Nov 25, 2015
2 parents 3176257 + 7860522 commit 9109ab0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions AppDB/datastore_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -3316,9 +3316,11 @@ def get_range_composite_query(self, query, filter_info):
value = ''
index_value = ""
equality_value = ""
oper = datastore_pb.Query_Filter.GREATER_THAN_OR_EQUAL
direction = datastore_pb.Query_Order.ASCENDING
for prop in definition.property_list():
# Choose the least restrictive operation by default.
oper = datastore_pb.Query_Filter.GREATER_THAN_OR_EQUAL

# The last property dictates the direction.
if prop.has_direction():
direction = prop.direction()
Expand Down Expand Up @@ -3395,7 +3397,7 @@ def get_range_composite_query(self, query, filter_info):
if direction == datastore_pb.Query_Order.DESCENDING:
start_value = equality_value
end_value = index_value + self._TERM_STRING
elif oper == datastore_pb.Query_Filter.EQUAL:
elif oper == datastore_pb.Query_Filter.EQUAL:
if value == "":
start_value = index_value
end_value = index_value + self.MIN_INDEX_VALUE + self._TERM_STRING
Expand Down

0 comments on commit 9109ab0

Please sign in to comment.