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
commit 4187be2dc3
6 changed files with 48 additions and 0 deletions

View File

@ -48,5 +48,13 @@ class {{classname}}(object):
{{/description}} {{/description}}
self.{{name}} = None # {{{datatype}}} self.{{name}} = None # {{{datatype}}}
{{/vars}} {{/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}} {{/model}}
{{/models}} {{/models}}

View File

@ -52,3 +52,11 @@ class Category(object):
self.name = None # str self.name = None # str
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))

View File

@ -85,3 +85,11 @@ class Order(object):
self.complete = None # bool self.complete = None # bool
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))

View File

@ -85,3 +85,11 @@ class Pet(object):
self.status = None # str self.status = None # str
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))

View File

@ -52,3 +52,11 @@ class Tag(object):
self.name = None # str self.name = None # str
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))

View File

@ -101,3 +101,11 @@ class User(object):
self.user_status = None # int self.user_status = None # int
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))