Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
Fix call to complex filter and usage of additionalOprands
Browse files Browse the repository at this point in the history
  • Loading branch information
janua committed Jan 11, 2016
1 parent 5dbff32 commit 76b01a1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions FuelSDK/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,16 @@ def __init__(self, auth_stub):

def additionalOperandToSimpleFilter(self, operand):
simpleFilter = self.auth_stub.soap_client.factory.create('SimpleFilterPart')
for k, v in additional_operand.items():
for k, v in operand.items():
simpleFilter[k] = v
return simpleFilter


def complexFilter(self, leftOperand, rightOperand, logicalOperator, additionalOperands):
complexFilter = self.auth_stub.soap_client.factory.create('ComplexFilterPart')

complexFilter["LeftOperand"] = self.filterFor(self.auth_stub, leftOperand)
complexFilter["RightOperand"] = self.filterFor(self.auth_stub, rightOperand)
complexFilter["LeftOperand"] = self.filterFor(leftOperand)
complexFilter["RightOperand"] = self.filterFor(rightOperand)
complexFilter["LogicalOperator"] = logicalOperator

for op in additionalOperands:
Expand All @@ -182,13 +182,13 @@ def simpleFilter(self, operand):
def filterFor(self, operand):
result = None
if operand.has_key('LogicalOperator'):
result = self.complexFilter(self.auth_stub,
result = self.complexFilter(
operand["LeftOperand"],
operand["RightOperand"],
operand["LogicalOperator"],
operand.get('AdditionalOperands', []))
else:
result = self.simpleFilter(self.auth_stub, operand)
result = self.simpleFilter(operand)

return result

Expand Down

0 comments on commit 76b01a1

Please sign in to comment.