Hi All,
I am trying to define a web service that returns a complex types. The
elements of the type are only determined at run time.
Specifically, I am returning search results from a table.
When I have a class like
class MySearchResult(object):
score= 0
def __init__(self, **kw):
self.__dict__.update(kw)
I want to
@wsexpose([MySearchResult])
@wsvalidate(....)
def simplesearch(self, ....):
search_results = ....
MySearchResults=[]
for r in search_results:
mr = MySearchResult()
mr.__setattr__("fieldname1", "value1")
MySearchResults.append(mr)
return MySearchResults
I was hoping that the result would look something like
<item>
<fieldname1>value1</fieldname1>
</item>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---