Merge pull request #767 from geekerzp/develop_2.0_python_model

Pretty print for models of python client
This commit is contained in:
Tony Tam
2015-05-20 22:46:41 -07:00
6 changed files with 48 additions and 0 deletions

View File

@@ -48,5 +48,13 @@ class {{classname}}(object):
{{/description}}
self.{{name}} = None # {{{datatype}}}
{{/vars}}
def __repr__(self):
properties = []
for p in self.__dict__:
if p != 'swaggerTypes' and p != 'attributeMap':
properties.append('{prop}={val!r}'.format(prop=p, val=self.__dict__[p]))
return '<{name} {props}>'.format(name=__name__, props=' '.join(properties))
{{/model}}
{{/models}}