What I meant to add was that the result comes back with empty items.

Is there any way to set the attributes at runtime ?

Thanks all

Patrick

On Sep 12, 11:02 am, Pezzi <[EMAIL PROTECTED]> wrote:
> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to