Commit bc9e2c0c authored by oroulet's avatar oroulet

add __str__ and __repr__ to autogenerated structures from server datamodel

parent 96ae897e
......@@ -103,6 +103,11 @@ class {self.name}(object):
code += f" ('{field.name}', '{uatype}'),\n"
code += " ]"
code += """
def __str__(self):
vals = [name + ": " + str(val) for name, val in self.__dict__.items()]
return self.__class__.__name__ + "(" + ", ".join(vals) + ")"
__repr__ = __str__
def __init__(self):
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment