aboutsummaryrefslogtreecommitdiffstats
path: root/gsxws/core.py
diff options
context:
space:
mode:
authorFilipp Lepalaan <f@230.to>2013-10-11 12:09:03 +0300
committerFilipp Lepalaan <f@230.to>2013-10-11 12:09:03 +0300
commitafc39a635a2ee508bad3f4a79096ca66eb96969e (patch)
treece65e5c644e5be867e2384a061d58958880d70d8 /gsxws/core.py
parent23258a4291d5419a553c8591e38cb8ad80927a89 (diff)
downloadpy-gsxws-afc39a635a2ee508bad3f4a79096ca66eb96969e.tar.gz
py-gsxws-afc39a635a2ee508bad3f4a79096ca66eb96969e.tar.bz2
py-gsxws-afc39a635a2ee508bad3f4a79096ca66eb96969e.zip
Added __unicode__ and __str__ to GsxObject
Diffstat (limited to 'gsxws/core.py')
-rw-r--r--gsxws/core.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/gsxws/core.py b/gsxws/core.py
index eaf241d..b3c0d8b 100644
--- a/gsxws/core.py
+++ b/gsxws/core.py
@@ -392,6 +392,12 @@ class GsxObject(object):
return root
+ def __unicode__(self):
+ return ET.tostring(self.to_xml('root'), encoding='UTF-8')
+
+ def __str__(self):
+ return unicode(self).encode('utf-8')
+
class GsxRequestObject(GsxObject):
"The GSX-friendly representation of this GsxObject"