Reputation: 151
I want to return a instance of user defined class and list of instances of user defined class from a ladon function? Is it possible?
Upvotes: 0
Views: 130
Reputation: 57322
this might help you its something like this
from ladon.ladonizer import ladonize
from ladon.types.ladontype import LadonType
class Response(LadonType):
values = [int]
class MyService(object):
@ladonize(int, int, rtype=Response)
def foo(self, a, b):
result = Response()
result.values = [a+b, a*b]
return result
Upvotes: 0