From d020b5d452b85becd77b1d1a76e01751c8aa2f05 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Mon, 13 May 2013 20:04:21 +0300 Subject: Fix bool type check in GsxObject --- gsxws/core.py | 9 +++------ gsxws/repairs.py | 3 ++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/gsxws/core.py b/gsxws/core.py index 4e35c76..2579310 100644 --- a/gsxws/core.py +++ b/gsxws/core.py @@ -300,6 +300,9 @@ class GsxObject(object): value = base64.b64encode(value.read()) + if isinstance(value, bool): + value = "Y" if value else "N" + if isinstance(value, int): value = str(value) @@ -309,12 +312,6 @@ class GsxObject(object): if isinstance(value, time): value = value.strftime(self._formats['tf']) - if isinstance(value, bool): - value = "Y" if value else "N" - - if isinstance(value, date): - value = value.strftime(self._formats['df']) - self._data[name] = value def __getattr__(self, name): diff --git a/gsxws/repairs.py b/gsxws/repairs.py index 5ba0861..4d0d1f5 100644 --- a/gsxws/repairs.py +++ b/gsxws/repairs.py @@ -181,7 +181,8 @@ class CarryInRepair(Repair): GSX validates the information and if all of the validations go through, it obtains a quote for the repair and creates the carry-in repair - >>> CarryInRepair(customerAddress=Customer(firstName='Filipp'))._data + >>> CarryInRepair(requestReviewByApple=True).requestReviewByApple + 'Y' """ _namespace = "emea:" -- cgit v1.2.3